search for: dft1

Displaying 2 results from an estimated 2 matches for "dft1".

Did you mean: df1
2006 Dec 05
0
How to join data.frames containing Surv objects?
...arttime <- rep(0,5) stoptime <- 1:5 event <- c(1,0,1,1,1) group <- c(1,1,1,2,2) ## build Surv object survobj <- Surv(starttime, stoptime, event) ## build data.frame with Surv object df.test <- data.frame(survobj, group); df.test; str(df.test) ## split in two data frames dft1 <- df.test[1:3,]; dft1; str(dft1); class(dft1$survobj) # class is Surv dft2 <- df.test[4:5,]; dft2; str(dft2); class(dft2$survobj) # class is Surv ## rbind in one data.frame dft12 <- rbind(dft1, dft2); dft12; str(dft12); class(dft12$survobj) # class is matrix ## merge in one data.frame...
2012 Jan 17
2
How to loop on file names
...example of what I am trying to do. List of files: file1(A,B,C, D1...Dn), file2(A,B,C,E1,...,En), file3(A,B,C,F1,...,Fn) Procedure I want to apply on each file: dft <- melt(df,id=c('A','B','C')) dft$X <- substr(dft$variable,1,3) dft$Y <- substr(dft$variable,4,8) dft1 <- cast(dft, A+B+C+X ~ Y,value="response") As you see all the files contains the same 3 variables A,B,C that I use in the procedure. So I want to apply the procedure on all the file in a loop. Something like : filelist <- c('file1' , 'file2' , 'file3') fo...