Description Usage Arguments Value Author(s) Examples
Create netCDF from zoo time series object.
1 | help_ts2netcdf(ts, unit, var.name, latitude, longitude, name.nc)
|
ts |
zoo time series object, named. |
NULL, saves netCDF file containing all variables of zoo time series in working directory
Johannes Brenner johannes.brenner@ufz.de
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | library(zoo)
# dummy time series
date <- seq(as.Date("2010-01-01"),as.Date("2016-01-01"),1)
ts_data <- cbind(rnorm(length(date)), rnorm(length(date)))
colnames(ts_data) <- c("A","B")
ts_date <- zoo(ts_data, date)
ts_POSIX <- zoo(ts_data, as.POSIXct(date))
ts_chron <- zoo(ts_data, as.chron(date))
# dummy lat, lon matrix
lat = as.matrix(40, ncol=1); dimnames(lat) = list("x","y")
lon = as.matrix(5 , ncol=1); dimnames(lon) = list("x","y")
help_ts2netcdf(ts = ts_date, unit = c("UNIT varA","UNIT varB"),
latitude = lat, longitude = lon, name.nc="test_date")
help_ts2netcdf(ts = ts_POSIX, unit = c("UNIT varA","UNIT varB"),
latitude = lat, longitude = lon, name.nc="test_POSIX")
help_ts2netcdf(ts = ts_chron, unit = c("UNIT varA","UNIT varB"),
latitude = lat, longitude = lon, name.nc="test_chron")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.