Re: [R] means by year, month and day

2016-07-18 Thread Tom Mosca
, 2016 12:14 PM To: Tom Mosca Cc: jim holtman; Jianling Fan; r-help@r-project.org Subject: Re: [R] means by year, month and day If you are very inexperienced with R you still have time to forget you ever heard of the attach function. Your code > attach(datATMP) > datATMP1 <- datA

Re: [R] means by year, month and day

2016-07-18 Thread William Dunlap via R-help
p working on it. > > > > Thank you for your kind response and examples. I will study them. > > > > Sincerely, Tom > > > > > > > From: jim holtman [jholt...@gmail.com] > Sent: Sunday, July 17, 2016 7:14 PM > To: Jianling

Re: [R] means by year, month and day

2016-07-18 Thread Tom Mosca
do want to develop better form. So, I'll keep working on it. Thank you for your kind response and examples. I will study them. Sincerely, Tom From: jim holtman [jholt...@gmail.com] Sent: Sunday, July 17, 2016 7:14 PM To: Jianling Fan Cc: Tom Mosca;

Re: [R] means by year, month and day

2016-07-17 Thread jim holtman
Here is an example of using dplyr. Please provide a reasonable subset of data. Your was all for the same date. Use 'dput' to put in your email. > x <- read.table(text = " X.YY MM DD hh WDI R.WSP D.GST PRES ATMP DEWP + 2015 1 1 0 328 3.6 4.5 1028.0 3.8 -3.5 + 2015 1 1 1 3

Re: [R] means by year, month and day

2016-07-17 Thread Jianling Fan
Hello Tom, try aggregate() or cast(). Both works.I prefer the latter. library(reshape) desc<-melt(mydata, measure.vars=c("WDI","R.WSP", "D.GST", "PRES", "ATMP", "DEWP"), id.vars=c("X.YY","MM","DD")) summary<-cast(desc, X.YY+MM+DD~variable, mean) On 17 July 2016 at 06:22, Tom

[R] means by year, month and day

2016-07-17 Thread Tom Mosca
Hello Good Folk, My dataframe looks like this: > mydata X.YY MM DD hh WDI R.WSP D.GST PRES ATMP DEWP 12015 1 1 0 328 3.6 4.5 1028.0 3.8 -3.5 22015 1 1 1 300 2.1 2.7 1027.9 3.7 -4.4 32015 1 1 2 264 2.4 2.9 1027.7 3.6 -4.5 42015 1 1 3 230 4