search for: num4

Displaying 8 results from an estimated 8 matches for "num4".

Did you mean: num
2006 Feb 09
1
List Conversion
Hello, I have a list (mode and class are list) in R that is many elements long and of the form: >length(list) [1] 5778 >list[1:4] $ID1 [1] "num1" $ID2 [1] "num2" "num3" $ID3 [1] "num4" $ID4 [1] NA I'd like to convert the $ID2 value to be in one element rather than in two.?? It shows up as c(\"num2\", \"num3\") if I try to use paste(list[2], collapse=""). I need to do this over the length of the entire list, however list2 <- apply(list,...
2005 Jul 28
1
Unexpected behavior in recode{car}
...avior. Consider the following example: ## Begin cut-and-paste example require( car ) set.seed(12345) nn <- sample( c( 2, 4 ), size=50, replace=TRUE ) rr <- recode( nn, "2='TWO';4='FOUR'" ) table( rr, exclude=NULL ) ss <- recode( nn, "2='Num2';4='Num4'" ) # Doesn't work as expected table( ss, exclude=NULL ) tt <- recode( nn, "2='TWO'; 4='Num4'" ) table( tt, exclude=NULL ) uu <- recode( nn, "2='Num2'; 4='FOUR'" ) table( uu, exclude=NULL ) ## End cut-and-paste example All but...
2010 Feb 01
1
How to repeat "for" function?
...-0.5,0.2,1,0.2,0.3,-0.5,0.2,1),4,4,byrow=T) set.seed(428) X=mvrnorm(n,m2,c4) X.pca<-princomp(X) loadings(X.pca) pc=X.pca$loadings[,1] ## Part B num1=rep(1:n) for(i in 1:n)num1[i]=pc[1]%*%X[i,1] num2=rep(1:n) for(i in 1:n)num2[i]=pc[2]%*%X[i,2] num3=rep(1:n) for(i in 1:n)num3[i]=pc[3]%*%X[i,3] num4=rep(1:n) for(i in 1:n)num4[i]=pc[4]%*%X[i,4] den=rep(1:n) for(i in 1:n)den[i]=pc%*%X[i,] r1=num1/den r2=num2/den r3=num3/den r4=num4/den MLAV=sum(r2>r1 & r2>r3 & r2>r4) MLAV Best regards, ayu -- View this message in context: http://n4.nabble.com/How-to-repeat-for-function-tp...
2013 Jun 11
1
mapply on multiple data frames
...ple data frames. All data frames have the same structure. Here is my code so far: f<-function(x,y) { test<-t.test(x$col1[x$col3=="num",],v$col2[x$col3=="num",],paired=T,alternative="greater") out<-test$p.value return(out) } all_nums<-list(num1,num2,num3,num4) all_dfs<-list(df1,df2,df3,df4) mapply(f,all_dfs,all_nums) This tells me that $ operator is invalid for atomic vectors. I have tried shifting to notation using [ ,] to denote columns, but that gives me this error: incorrect number of dimensions. Thank you in advance, Elizabeth
2012 Aug 31
2
[LLVMdev] How to write a regression test case?
...dNameAllUsedStructsAndMergeFunctions() was removed.for this the module data can not be translated correctly. when i try to rewrite this pass,i found much interfaces of module have been changed. i write a test which contian a struct like this struct student{ long num; int num2; int num3; int num4; }; after analyze the struct should be modify like this: struct student{ long num; int num2; int num3; int num4; char add[4]; }; but now, i do not know which function can do this work in Module in llvm162227. thanks, Regards, changcheng On Wed, Aug 29, 2012 at 10:29 PM, Triple Yang...
2012 Aug 29
0
[LLVMdev] How to write a regression test case?
aha, that's quite straightforward. 2012/8/29 Changcheng Wang <changcheng at multicorewareinc.com>: > hi,yang: > i had delete the temporary files,sorry to trouble you. > it is so easy: // RUN: rm .... > > Regards > changcheng > > On Wed, Aug 29, 2012 at 2:41 PM, Changcheng Wang > <changcheng at multicorewareinc.com> wrote: >> hi,yang: >> how
2012 Aug 29
3
[LLVMdev] How to write a regression test case?
hi,yang: i had delete the temporary files,sorry to trouble you. it is so easy: // RUN: rm .... Regards changcheng On Wed, Aug 29, 2012 at 2:41 PM, Changcheng Wang <changcheng at multicorewareinc.com> wrote: > hi,yang: > how can i remove the temporary files? > if i can remove them,all is ok! > > yours: > > changcheng > > On Wed, Aug 29, 2012 at 2:14 PM, Changcheng
2010 Aug 24
0
mlm for within subject design
...gam.object <- gam(YVAR~1, data=gam.data) step.object <-step.gam(gam.object, scope=list( "FAC1"=~1+FAC1, "FAC2"=~1+FAC2, "FAC3"=~1+FAC3, "NUM1"=~1+NUM1+ns(NUM1,df=2), "NUM2"=~1+NUM2+ns(NUM2,df=2), "NUM3"=~1+NUM3+ns(NUM3,df=2), "NUM4"=~1+NUM4+ns(NUM4,df=2), "NUM5"=~1+NUM5+ns(NUM5,df=2), "NUM6"=~1+NUM6+ns(NUM6,df=2), "NUM7"=~1+NUM7+ns(NUM7,df=2), "NUM8"=~1+NUM8+ns(NUM8,df=2), "NUM9"=~1+NUM9+ns(NUM9,df=2), "NUM10"=~1+NUM10+ns(NUM10,df=2), "NUM11"=~1+NUM11+...