similar to: random value generation with added constraint.

Displaying 20 results from an estimated 8000 matches similar to: "random value generation with added constraint."

2011 Jun 18
3
how to subtract one string from another in R
Dear R Group Here is what i am trying to do.. but couldnt figure out how.. string<-"ABC DEFG HIJKLM NOPQ RSTUV WXY" string1<-substr(string,1,4) I want to create an R object string 2 ( following the logic shown).. R does not allow string subtraction.. any suggestions how to achieve this? string2<-string-string1 (it should now hold "DEFG HIJKLM NOPQ RSTUV WXY" I
2011 Apr 10
4
Password-protect R script files
There was a question in R forum very long time back.. on how to protect R Script files from inadvertent editing by users. There is a way to do this from within R, atleast in Windows XP I have tried this and it certainly works , The method is very different from the OS based folder protection route, however making available such a method in the open forum would only kill the very spirit of R.
2012 Nov 15
3
GUI Development reg
Dear R Group I have a character vector from which I want to select a few elements and create a new character vector. I need a GUI to do this in R Script. Can someone help? a<-c("A","B","C","D","E") ## I want to have a GUI in R that will display elements in "object a" as a drop down list.. from there I want to be able to select a
2010 Sep 07
1
Help with repeating values in a column of dataframe in R on a random pattern- reg
Dear Group I have to populate a column in a R dataframe containing say 99 rows, where for every 3 row one row (randomly determined) of the column should take the value 1 and the other 2 row of that column should take the value 0. I used the command dataframe$new<-rep(sample(c(0,1,0),3,replace=FALSE),99) This command repeats the same patter of response across the entire column.. I would
2012 Feb 27
1
win zip archive of library(HH) for R2.12.0
Dear R Group Can any body point me to a link from where I can get zip archive of the package HH for R 2.12.0? Thanks & Regards Vijayan Padmanabhan "What is expressed without proof can be denied without proof" - Euclide. Please visit us at www.itcportal.com ****************************************************************************** This Communication is for the exclusive use
2017 Jul 14
0
Help with R script
@Don your solution does not solve Vijayan's scenario 2. I used spread and gather for that. An alternative solution to insert mising Fval - picking up with Don's newtst - is newtst <- c("FName: fname1", "Fval: Fval1.name1", "FName: fname2", "Fval: Fval2.name2", "FName: fname3", "FName: fname4", "Fval: fval4.fname4")
2017 Jul 13
2
Help with R script
Using Ulrik?s example data (and assuming I understand what is wanted), here is what I would do: ex.dat <- c("FName: fname1", "Fval: Fval1.name1", "Fval: ", "FName: fname2", "Fval: Fval2.name2", "FName: fname3") tst <- data.frame(x = ex.dat, stringsAsFactors=FALSE) sp <- strsplit(tst$x, ':', fixed=TRUE) chk <-
2017 Jul 13
0
Help with R script
Hi Vijayan, one way going about it *could* be this: library(dplyr) library(tidyr) library(purrr) ex_dat <- c("FName: fname1", "Fval: Fval1.name1", "Fval: ", "FName: fname2", "Fval: Fval2.name2", "FName: fname3") data.frame(x = ex_dat) %>% separate(x, c("F1", "F2"), sep = ": ") %>% filter(F2
2012 Feb 14
1
help with matrix column cleaning
Dear R Group I have a matrix object in R, where i want to retain only those columns which have each row from a different group.. see the example below.. team1<-c("a1","a2","b1","b2","b3","c1","c2") teams<-combn(team1, 3) I want a function which will delete all columns in the teams matrix that have more than 1 row
2010 Sep 22
2
randomForest - partialPlot - Reg
Dear R Group I had an observation that in some cases, when I use the randomForest model to create partialPlot in R using the package "randomForest" the y-axis displays values that are more than -1! It is a classification problem that i was trying to address. Any insights as to how the y axis can display value more than -1 for some variables? Am i missing something! Thanks Regards
2011 Apr 02
4
help
Dear R Help group I need to run a command line script from within R session. I am not clear how i can acheive this. I tried shell and system function, but i am missing something critical.can someone provide help? My intention is to create a pdf file of a plot in R and then attach existing files from my system as attachment into the newly created pdf file. Any help would be greatly appreciated..
2011 Jun 04
1
library(SenoMineR)- Triangle Test Query
Dear R Group I was trying to use the triangle.test function in SensoMineR and strangely i encounter a error in the output of preference matrix from the analysis. To illustrate, pl see the following dataframe of a design with the response and preference collected as shown below: design<-structure(list(`Product X` = c(3, 1, 4, 2, 4, 2, 1, 3, 4, 2, 4, 2, 1, 3, 4, 2, 4, 2, 3, 1), `Product Y` =
2010 May 17
1
Query on linear mixed model
Hi R Forum I am a newbie to R and I have been amazed by what I can get my team to accomplish just by implementing Scripting routines of R in all my team's areas of interest.. Recently i have been trying to adopt R scripting routine for some analysis with longitudanal data.. I am presenting my R script below that I have tried to make to automate data analysis for longitudanal data by employing
2011 May 26
1
dataframe - column value calculation in R
Dear RGroup I have a requirement for which I am seeking help. I am looking at automating the last column calculation through R when having the data of the other columns as a dataframe, In excel I can do using the formula function as given below, however, hereagain for the number of observations that come under control, I need to write the formula seperately for each cell and then I can block
2017 Jul 13
2
Help with R script
Dear R-help Group Scenario 1: I have a text file running to 1000 of lines...that is like as follows: [922] "FieldName: Wk3PackSubMonth" [923] "FieldValue: Apr" [924] "FieldName: Wk3PackSubYear" [925] "FieldValue: 2017" [926] "FieldName: Wk3Code1" [927] "FieldValue: " [928] "FieldValue: K4" [929] "FieldName:
2012 Feb 21
0
add.cross.strata.test function query
Dear R Group in package Deducer, how should i use the add.cross.strata.test() function to pass the chi.squared.test function as htest argument? ##########Example########### library(Deducer) dat<-data.frame(a=rnorm(100)>.5,b=rnorm(100)>0,c=rnorm(100)>(-.5)) tables<-contingency.tables( row.vars=a, col.vars=b, stratum.var=c,data=dat)
2011 Jun 09
1
lattice plot query
Dear R Group I have the following data for which I am trying to create subject wise lattice plot for a given attribute and product . though the lattice plot is generated, for some reasons that i dont understand in each plot the subject panels take a random order, I would rather want all the plots to display the subject order in the same order as how i have ordered this particular factor level.
2010 Sep 09
0
Help with HB analysis in R for a conjoint study Data
Dear Group I was referring to a conjoint analysis scenario using R from the paper referred below: Agricultural Information Research 17(2),2008,86-94 available online at www.jstage.jst.go.jp/ This paper describes the data modelling of a conjoint study design based on conditional logit procedure. I understand that Heirarchical Bayes is asymptotically equivalent to Conditionallogit. However it
2011 Apr 07
0
Hypercluster Finder Function in R
Dear R Users I am looking at carrying out Multivariate Supervised Discretization on a set of continuous attributes to determine cut off values on each attribute which would allow best explanation of a binary outcome variable. I understand that there is an algorithm for doing this (The HyperCluster Finder Algorithm from the paper -Muhlenbach F., & Rakotomalala R. (2002). Multivariate
2012 Feb 27
0
Suggestion on Model Def - reg in nlme
Dear RGroup I have a data of the type shown below: I am trying to use lme function followed by post hoc test as given in the code below. Am I right in my model definition, given the problem data structure. in the example, i have used column names of my data frame so that it is self explanatory. library(reshape) library(nlme) library(multcomp)