[R] cumulative data monthly
Jeff Newmiller
jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Sun Jan 27 16:41:20 CET 2019
Are you looking for a plot where each point represents a month? Or a plot where each point represents the accumulated precipitation so far that month? The latter seems closer to your computations so far, but doesn't seem like a typical way to present precipitation data...
On January 27, 2019 7:25:17 AM PST, Diego Avesani <diego.avesani using gmail.com> wrote:
>Dear all,
>
>I have a set of data with has hourly value:
>
># ID
># Lo
># L
># Q
>Time, T, RH,PSFC,DIR,VEL10, PREC, RAD, CC,FOG
>yyyy-mm-dd hh:mm, °C, %, hPa, °N, m/s, mm/h,W/m², %,-
>2012-01-01 06:00, -0.1,100, 815,313, 2.6, 0.0, 0, 0,0
>2012-01-01 07:00, -1.2, 93, 814,314, 4.8, 0.0, 0, 0,0
>2012-01-01 08:00, 1.7, 68, 815,308, 7.5, 0.0, 41, 11,0
>2012-01-01 09:00, 2.4, 65, 815,308, 7.4, 0.0, 150, 33,0
>.....
>.....
>
>I was able to read it, create my-own data frame and to plot the total
>cumulative function.
>This is basically what I have done:
>
>dati <- read.csv(file="116.txt", header=FALSE, sep="," ,
>na.strings="-999",skip = 6)
>colnames(dati)=c("DATAORA","T", "RH","PSFC","DIR","VEL10", "PREC",
>"RAD",
>"CC","FOG")
>
>dati$DATAORA<-as.POSIXct(strptime(dati$DATAORA,format="%Y-%m-%d
>%H:%M"))
>
>
>P <- cumsum(dati$PREC)
>plot(dati$DATAORA, P)
>
>I would like to select the data according to an starting and ending
>date.
>In addition, I would like to plot the monthly and not the total one.
>I mean, I would like to have a cumulative plot for each month of the
>selected year.
>
>I am struggling with "ddply" but probably it is the wrong way.
>
>Could someone help me? Really Really thanks,
>
>
>Diego
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>R-help using 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.
--
Sent from my phone. Please excuse my brevity.
More information about the R-help
mailing list