Description Usage Arguments See Also Examples
Apply a function to each value of the value field of the
data frame conserving the other fields of the data frame
using tapply
1 2 3 |
data |
data frame |
TimeField |
character string containg time field of
|
ValueField |
character string containg time field of
|
add_fields |
character string. Default is
|
FactorFields |
character string indicating the name of data frema fiels using as factors |
FUN |
atomic function |
return.data.frame |
logical vaue. If it is
|
... |
further arguments for |
tapply
,melt
,show.year.month.season
1 2 3 4 5 6 7 8 9 10 11 | 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)
meteoPrec2 <- ncvar_get_df_values(nc=nc,x="Prec",verbose=TRUE,show_year=TRUE,show_month=TRUE)
nc_close(nc)
MonthlyPrec <- tdfapply(data=meteoPrec,FactorFields=c("Station","month","year"),FUN=sum,na.rm=TRUE)
str(MonthlyPrec)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.