View source: R/functions_netCDF.R
create_example_netCDFs | R Documentation |
This function creates different netCDFs for all requested conditions:
data_str
type_timeaxis
create_example_netCDFs(
path,
data_str = c("xyzt", "xyt", "xyz", "xy", "szt", "st", "sz", "s"),
type_timeaxis = c("timeseries", "climatology"),
overwrite = FALSE
)
path |
A character string. The path to where the files will be written to disk. |
data_str |
A character string describing the dimensions of |
type_timeaxis |
A character string. Describing if the time dimension represents a time series or a climatological time. |
overwrite |
A logical value. If |
A named list, invisibly, of full paths to the created files on disk.
tmp_nc <- create_example_netCDFs(tempdir(), "xyt", "timeseries")
data_xyt <- read_netCDF(
tmp_nc[["xyt"]],
method = "array",
xy_names = c("x", "y")
)
if (requireNamespace("graphics")) {
graphics::persp(
x = data_xyt[["xyspace"]][["x"]],
y = data_xyt[["xyspace"]][["y"]],
z = data_xyt[["data"]][, , 15],
theta = 30,
phi = 30,
expand = 0.5,
col = "lightblue"
)
}
unlink(unlist(tmp_nc))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.