Re: [R] Data Manipulation in R

2013-10-21 Thread arun
Hi, I am getting this.  res <- lapply(seq_len(nrow(Y1)),function(i) {dat <- data.frame(X=i,Y1=unlist(Y1[i,]),Y2=unlist(Y2[i,])); row.names(dat) <- 1:nrow(dat); write.csv(dat,paste0("Anam",i,".csv"),row.names=FALSE,quote=FALSE)}) dat1 <- read.csv("Anam1.csv",header=TRUE)  dat1   X Y1 Y2 1 1

Re: [R] Data Manipulation in R

2013-10-21 Thread Anamika Chaudhuri
Hi Arun: Thanks for your help. Seperate files are being created by concatenating the rows from the two files but I was looking to have them as columns rather than text. This is the way it appears in Excel with row # at the beginning. X Y1 Y2 1 1 4 0 20 17 1 20 52 15 18 Ideally I would like it to

Re: [R] Data Manipulation in R

2013-10-20 Thread arun
Hi, May be this helps: Y1 <- read.table(text="V1 V2 V3 V4 1 4 0 20 17 2 4 0 15 17 3 2 0 13 21",sep="",header=TRUE) Y2 <- read.table(text="V1 V2 V3 V4 1 20 52 15 18 2 18 54 14 21 3 18 51 13 21",sep="",header=TRUE)  res <- lapply(seq_len(nrow(Y1)),function(i) {dat <- data.frame(X=i,Y1=unlist(Y1[i,]

Re: [R] Data manipulation in R

2010-09-24 Thread Dennis Murphy
Hi: Please provide a minimal reproducible example that resembles your real data so that people can try it out and provide potential solutions for you. Show what you tried that failed, and what you expect. A number of people on this list are very adept in data summarization, but most of them are lo