search for: varc

Displaying 12 results from an estimated 12 matches for "varc".

Did you mean: var
2011 Sep 12
2
Automated generation of combinations
Hello,   I'd like to generate automatically all the possible combinations of a set of 8 variables (there are 535, too many to do it by hand). For example:   input: varA, varB, varC output: varA+varB+varC             varA+varB             varA+varC             varB+varC             varA             varB             varC Is there any function that produces this option?   Thank you [[alternative HTML version deleted]]
2012 Jan 01
1
How to pass in a list of variables as an argument to a function?
...n advance, Randall ################################################################# # libraries used library(reshape) # create some data similar to use case myData = data.frame(expand.grid(varA=c("a", "b", "c"), varB=c("d", "e", "f"), varC=c("g", "h", "i"), varD=c("old", "new")), n=1000, fail=rbinom(2700,1000, 0.01)) # add in one more column myData$pass = myData$n-myData$fail # List of grouping vars. ?I would like to pass this object around and use it as arguments in functions myGro...
2007 Jul 12
1
ggplot doesnt work in loops?
Dear list members I am still a newbie so might be asking a stupid question, but I can't get ggplot to work in a loop (or a "while" statement for that matter). # to take a minimal example - mydata$varc = c(1,2,3) for (i in 1:1){ jpeg("test3.jpg") plot(mydata$varc) #ggplot(mydata, aes(x=mydata$varc)) + geom_bar() dev.off() } this produces an empty jpeg, whereas the content of the loop produces the jpeg correctly. a standard plot() does work inside the loo...
2011 May 05
3
cross-correlation table with subscript or superscript to indicate significant differences
Hi, I wonder whether the following is possible with R, and whether anyone has done that and can share his/her code with me. I have a correlation matrix, and I want to create a correlation table that I can copy to Microsoft Word with a superscript above each correlation, indicating significant differences in the same row. That is, when correlations in the same row do not share superscript, it means
2006 Jan 26
1
Using special characters
...They don't appear... I don't know if it is because I'm using a linux platform... The script is the following: library(grDevices) jpeg(file="Fronteira/FronteiraNova.jpeg", bg="white", quality=100,width = 600, height = 480) grafico.fe<-function(varFA,retFA,varC,retC,covRF,retRF,varD,retD) { minx<-min(100*sqrt(varFA),100*varC,100*sqrt(covRF[1,1]),100*sqrt(covRF[2,2]),100*sqrt(covRF[3,3]),100*sqrt(covRF[4,4]),100*varD) maxx<-max(100*sqrt(varFA),100*varC,100*sqrt(covRF[1,1]),100*sqrt(covRF[2,2]),100*sqrt(covRF[3,3]),100*sqrt(covRF[4,4]),100*varD)...
2007 Nov 07
2
creating a dynamic output vector
Let's say I have a program that returns variables whose names may be any string within the vector NAMES=c("varA","varB","varC","varD","varE","varF"..."varZ"), but I do not ever know which ones have actually been created. So in one example output, "varA", "varC", and "varD" could exist, but in another example output "varA", "varD&q...
2011 Apr 25
1
Trouble Passing a for loop variable (iteration #) to a data frame
...the iteration # to appear in the "iter" vector and therefore to the data frame? Many thanks, Galen > # fabdata3.r > # fabricate sample data > > #declare the mean duration > dur<-.04 > > #declare the stdDev of the rnorm() fcn (duration) > varc<-.01 > > sp<-numeric() > iter<-numeric() > ti<-numeric() > to<-numeric() > actdur<-numeric() > #newline<-data.frame(sp, iter, ti, to, actdur) > ds<-data.frame(sp, iter, ti, to, actdur) > > # BEGIN OUTER LOOP > for (sp in c(1:3))...
2012 Jul 18
1
fitting several lme sistematically
Dear R-list, I have a data set (in the following example called "a") which have: one "subject indicator" variable (called "id") three dependent variables (varD, varE, var F) three independent variables (varA, varB, varC) I want to fit 9 lme models, one per posible combination (DA, DB, DC, EA, EB, EC, FA, FB, FC). In stead of writting the 9 lme models, I want to do it sistematically (the example is a simplification of what I really have). Here you have the comands for the first model: library(nlme) set.seed(50...
2005 Apr 07
2
newline in lattice axis label
...C = rnorm(50), D = rnorm(50)) myplot <- xyplot(B + C + D ~ A, data = fakedf, outer = TRUE, allow.multiple = TRUE, layout = c(1,3), ylab = list(expression(paste( "VarB (cm" ^2, "), VarC (cm),\n or VarD (cm)"))), xlab = list("VarA (d)")) postscript("testfig.eps") print(myplot) dev.off() } As you can see, this is not producing the desired result, which is probably associated with 3 warnings: Warning messages: 1: font metrics unkno...
2011 Aug 03
1
Coefficient names when using lm() with contrasts
...s. Can anyone tell me how to get R to keep the coefficient names based on the factor levels whilst using contrasts rather than labelling them with integers? Many thanks in advance, Pete Cardiff, UK > dt=read.table("testreg.txt",sep=",",header=T) > dt ID VarA VarB VarC 1 1 cat 2 23 2 2 dog 3 56 3 3 rat 5 35 4 4 cat 2 43 5 5 cat 7 51 6 6 dog 3 31 7 7 dog 4 65 8 8 rat 1 18 9 9 rat 6 49 10 10 dog 3 28 > dt$VarA=relevel(dt$VarA,ref="dog") > treat3=matrix(-1/3,ncol=2,nrow=3);...
2008 Oct 29
0
reporting interactions of factors in linear mixed effects models
...report the results for a linear mixed effects model where the model includes as predictors three factors (facA, facB and facC), one of which (facA) interacts with the other two. facA and facB have two levels and facC has 3 levels. There are also several other continuous predictors (e.g. varA, varB, varC). My mixed model is specified with the following formula: model <- lmer(RT~ facA*facB*facC - facA:facB:facC - facB:facC + + varA + varB + varC + ... + (1|subject) + (1| item), data=alldata) Here are the estimates of the fixed effects: Estimate Std.E...
2009 Mar 27
2
Assignment to variables fails to loop
Dear all, I think I'm nearly there in writing R code which will read in files with two variable parts to the file name and then assigning these file names to objects, which also have two variable parts. I have got the code running without encountering errors, however, I receive 50+ of the same warnings: 1: In assign(paste("Fekete_", index$year, index$month, sep = ""),