, 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
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
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;
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
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
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
6 matches
Mail list logo