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,]

[R] Data Manipulation in R

2013-10-20 Thread Anamika Chaudhuri
Hi: I am looking for some help to manipulate data in R. I have two csv files. datasetY1 V1 "V2" "V3" "V4" 1 4 0 20 17 2 4 0 15 17 3 2 0 13 21 datasetY2 V1 "V2" "V3" "V4" 1 20 52 15 18 2 18 54 14 21 3 18 51 13 21 I want to be able to create separate csv files by taking the corresponding

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

[R] Data manipulation in R

2010-09-24 Thread Thomas Parr
If this has already been answered, my apologies in advance I am relatively new to this aspect of [R]. it is a bit of a basic question. I have 4 columns of data (site, Date, measurement type, value) in a tab delimited text file. Site is a site where measurements were collected, Date is a date i