[R] [FORGED] Re: Help with Binning Data

Shouro Dasgupta shouro at gmail.com
Fri Sep 11 13:06:37 CEST 2015


Dear Jim,

Thank you for your reply and pointing this out. I thought about it and then
I forgot. I have computed the weekly average (and max and min). The data is
below. Again I computed the max/min/mean by each year, so each file
contains data for one year. Can I modify the code I used for count? Thanks
again!

Sincerely,

Shouro

structure(list(City = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L), .Label = c("AKRON", "ALBANY", "ALBUQUERQUE", "ALLENTOWN",
"ATLANTA", "AUSTIN", "BALTIMORE", "BATON ROUGE", "BERKELEY",
"BIRMINGHAM", "BOISE", "BOSTON", "BRIDGEPORT", "BUFFALO", "CAMBRIDGE",
"CAMDEN", "CANTON", "CHARLOTTE", "CHATTANOOGA", "CHICAGO", "CINCINNATI",
"CLEVELAND", "COLORADO SPRINGS", "COLUMBUS", "CORPUS CHRISTI",
"DALLAS", "DAYTON", "DENVER", "DES MOINES", "DETROIT", "DULUTH",
"EL PASO", "ELIZABETH", "ERIE", "EVANSVILLE", "FALL RIVER", "FLINT",
"FORT WAYNE", "FRESNO", "FT WORTH", "GARY", "GLENDALE", "GRAND RAPIDS",
"HARTFORD", "HONOLULU", "HOUSTON", "INDIANAPOLIS", "JACKSONVILLE",
"JERSEY CITY", "KANSAS CITY", "KANSAS ITY", "KNOXVILLE", "Lansing ",
"LAS VEGAS", "LEXINGTON", "LINCOLN", "LITTLE ROCK", "LONG BEACH",
"LOS ANGELES", "LOUISVILLE", "LOWELL", "LYNN", "MADISON", "MEMPHIS",
"MIAMI", "MILWAUKEE", "MINNEAPOLIS", "MOBILE", "MONTGOMERY",
"NASHVILLE", "NEW BEDFORD", "NEW HAVEN", "NEW ORLEANS", "NEW YORK CITY",
"NEWARK", "NORFOLK", "OAKLAND", "OGDEN", "OKLAHOMA CITY", "OMAHA",
"PASADENA", "PATERSON", "PEORIA", "PHILADELPHIA", "PHOENIX",
"PITTSBURG", "PORTLAND", "PROVIDENCE", "PUEBLO", "READING", "RICHMOND",
"ROCHESTER", "ROCKFORD", "SACRAMENTO", "SALT LAKE CITY", "SAN ANTONIO",
"SAN CRUZ", "SAN DIEGO", "SAN FRANCISCO", "SAN JOSE", "SAVANNAH",
"SCHENECTADY", "SCRANTON", "SEATTLE", "SHREVEPORT", "SOMERVILLE",
"SOUTH BEND", "SPOKANE", "SPRINGFIELD", "ST LOUIS", "ST PAUL",
"ST PETERSBURG", "SYRACUSE", "TACOMA", "TAMPA", "TOLEDO", "TRENTON",
"TUCSON", "TULSA", "UTICA", "WASHINGTON", "WATERBURY", "WICHITA",
"WILMINGTON", "WORCESTER", "YONKERS", "YOUNGSTOWN"), class = "factor"),
    year = c(1970L, 1970L, 1970L, 1970L, 1970L, 1970L, 1970L,
    1970L, 1970L, 1970L), week = 1:10, tmax = c(-3.94999999999997,
    -6.28714285714283, -3.38285714285712, -4.24571428571427,
    0.188571428571453, -1.3485714285714, -1.40285714285712,
3.66285714285717,
    4.55000000000002, 5.7157142857143), tmin = c(-10.7316666666667,
    -12.2057142857143, -10.7885714285714, -13.3157142857143,
    -6.73999999999998, -8.60999999999998, -8.47999999999997,
    -6.02428571428569, -4.36428571428569, -2.43999999999998),
    tmean = c(-7.36583333333332, -9.77446428571427, -7.11892857142855,
    -9.07499999999999, -3.45946428571426, -4.99214285714284,
    -5.27874999999998, -1.31928571428569, -0.556249999999979,
    1.24714285714287)), .Names = c("City", "year", "week", "tmax",
"tmin", "tmean"), row.names = c(NA, 10L), class = "data.frame")

On Fri, Sep 11, 2015 at 12:14 PM, Jim Lemon <drjimlemon at gmail.com> wrote:

> Hi Shouro,
> While I have enjoyed the continuing discussion on this particular message
> (repression may have been a Galtonian slip), there is a lingering doubt in
> my mind. You say that you want to categorize the weekly temperatures for
> cities in bins of about 5.6 degrees (centigrade?). In almost all of the
> cities you include in your sample data (quite a few of which I have
> personal experience) the variation in temperature over a day, not to
> mention a week, is more than this. Unless you derive some particular
> temperature value, many cities will span more than one bin over a week.
> Have you already calculated a weekly average from your 3 hour observations?
>
> Jim
>
>
> On Fri, Sep 11, 2015 at 7:47 PM, John Kane <jrkrideau at inbox.com> wrote:
>
>> "that rely on profusion of dummies" :)
>>
>> +1
>>
>> John Kane
>> Kingston ON Canada
>>
>>
>> > -----Original Message-----
>> > From: r.turner at auckland.ac.nz
>> > Sent: Fri, 11 Sep 2015 12:22:38 +1200
>> > To: dwinsemius at comcast.net
>> > Subject: Re: [R] [FORGED] Re: Help with Binning Data
>> >
>> > On 11/09/15 11:57, David Winsemius wrote:
>> >
>> > <SNIP>
>> >
>> >> The urge to imitate other statistical package that rely on profusion
>> >> of dummies should be resisted. R repression functions can handle
>> >> factor variables ....
>> >
>> > <SNIP>
>> >
>> > Fortune? :-)
>> >
>> > cheers,
>> >
>> > Rolf
>> >
>> > --
>> > Technical Editor ANZJS
>> > Department of Statistics
>> > University of Auckland
>> > Phone: +64-9-373-7599 ext. 88276
>> >
>> > ______________________________________________
>> > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> > https://stat.ethz.ch/mailman/listinfo/r-help
>> > PLEASE do read the posting guide
>> > http://www.R-project.org/posting-guide.html
>> > and provide commented, minimal, self-contained, reproducible code.
>>
>> ____________________________________________________________
>> FREE ONLINE PHOTOSHARING - Share your photos online with your friends and
>> family!
>> Visit http://www.inbox.com/photosharing to find out more!
>>
>> ______________________________________________
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>


-- 

*Shouro Dasgupta*
PhD Candidate
Science and Management of Climate Change
Department of Economics | Ca' Foscari University of Venice
-------------------------------------------------------------------------------------------------------
Junior Researcher
Fondazione Eni Enrico Mattei (FEEM) | Centro Euro-Mediterraneo per i
Cambiamenti Climatici (CMCC)
Isola di San Giorgio Maggiore, 8
30124 Venezia
Phone: +39 041 2700 436

	[[alternative HTML version deleted]]



More information about the R-help mailing list