[R] Help with Binning Data

2015-09-10 Thread Shouro Dasgupta
Dear all, I have 3-hourly temperature data from 1970-2010 for 122 cities in the US. I would like to bin this data by city-year-week. My idea is if the temperature for a particular city in a given week falls within a given range (-17.78 & -12.22), (-12.22 & -6.67), ... (37.78 & 43.33), then the cor

Re: [R] Help with Binning Data

2015-09-10 Thread Bert Gunter
1. Posting in HTML largely negated your ability to provide data through dput(). Folow he posting guide and post in PLAIN TEXT only, please. 2. See ?cut . I think this will at least get you started. Cheers, Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is

Re: [R] Help with Binning Data

2015-09-10 Thread David Winsemius
On Sep 10, 2015, at 3:28 PM, Shouro Dasgupta wrote: > Dear all, > > I have 3-hourly temperature data from 1970-2010 for 122 cities in the US. I > would like to bin this data by city-year-week. My idea is if the > temperature for a particular city in a given week falls within a given > range (-17

Re: [R] Help with Binning Data

2015-09-11 Thread Shouro Dasgupta
Apologies for the HTML. It shouldn't have happened. I would like to use the dummies as independent variables in a regression. I did manage to use count of observations in a given range using the following code: for (i in filelist) { # i <- filelist[1] tmp1 <- as.data.table(read.csv(i, sep=",")