Re: [R] Splitting columns and forming new data files in R

2014-04-10 Thread Zilefac Elvis
Great. Thanks AK. On Thursday, April 10, 2014 11:14 PM, arun wrote: Hi, Ok, In that case, change `lst1New`.  Also, in your files, there was no "Sim" column.  So, I changed the name. lst1New <- lapply(lst1,function(x) {lst2 <- setNames(lapply(x,function(y) {dat <- read.table(y,sep=" ",head

Re: [R] Splitting columns and forming new data files in R

2014-04-10 Thread arun
Hi, Ok, In that case, change `lst1New`.  Also, in your files, there was no "Sim" column.  So, I changed the name. lst1New <- lapply(lst1,function(x) {lst2 <- setNames(lapply(x,function(y) {dat <- read.table(y,sep=" ",header=TRUE, stringsAsFactors=FALSE);names(dat)[5] <- "Sim"; dat[,1:5]}),na

Re: [R] Splitting columns and forming new data files in R

2014-04-08 Thread arun
Hi, Try: #Tmin,Tmax,Tmean,Precip #"Tmean" -999.9 in all files #working directory is "sample" #created folder "final" list.files() #[1] "coordinates.csv" "final" "Precip" "Tmax " #[5] "Tmin" Coord <- read.csv(list.files(pattern=".csv"),header=TRUE,stringsAsFactors=F