Description Usage Arguments Value See Also Examples
Function rollapply
applied to a Data Frame
structured as follows: Time,Station,Variable,Value
1 2 | rolldfapply(data, TimeField = "Time", ValueField = "value",
align = "right", ...)
|
data |
data frame |
TimeField |
character string containg time field of
|
ValueField |
character string containg time field of
|
align |
argument of |
... |
arguments for |
A data frame with the same format of data
with
"rolled" calculated values.
1 2 3 4 5 6 7 8 9 10 | library(ncdf4df)
## ncname <- "/Users/ecor/Dropbox/iasma/RMAWGENdev/ncdf4df/inst/trentino/data/trentino_hourlyweatherdata.nc"
ncname <- system.file("trentino/data/trentino_hourlyweatherdata.nc",package="ncdf4df")
nc <- nc_open(ncname)
meteoPrec <- ncvar_get_df_values(nc=nc,x="Prec",verbose=TRUE)
nc_close(nc)
width <- 3 ## rolling windows of 3 time inidices, e.g. hour
meteoPrec3h <- rolldfapply(data=meteoPrec,width=width,FUN=sum,align="right") ## l
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.