Re: [R] Melt and Rbind/Rbindlist

2015-02-01 Thread Shouro Dasgupta
Hello Mr. Holtman, Thank you very much for your reply and suggestion. This is what each Year's data looks like; tmp1 - structure(list(FIPS = c(1001L, 1003L, 1005L), X2026.01.01.1 = c(285.5533142, 285.5533142, 286.2481079), X2026.01.01.2 = c(283.4977112, 283.4977112, 285.0860291),

Re: [R] Melt and Rbind/Rbindlist

2015-01-31 Thread jim holtman
It would have been nice if you had at least supplied a subset (~10 lines) from a couple of files so we could see what the data looks like and test out any solution. Since you are using 'data.table', you should probably also use 'fread' for reading in the data. Here is a possible approach of

[R] Melt and Rbind/Rbindlist

2015-01-31 Thread Shouro Dasgupta
I have climate data for 20 years for US counties (FIPS) in csv format, each file represents one year of data. I have extracted the data and reshaped the yearly data files using melt(); for (i in filelist) { tmp1 - as.data.table(read.csv(i,header=T, sep=,)) tmp2 - melt(tmp1, id=FIPS)