View source: R/convert_sim_var.R
convert_sim_var | R Documentation |
allows you to provide specific variable or unit conversions to create a new variable
that can be used with plot_var_compare
, and others.
convert_sim_var(
nc_file = "output/output.nc",
...,
unit = "",
longname = "",
overwrite = FALSE
)
nc_file |
the netcdf output file |
... |
an expression to convert variable based on other variables or offsets |
unit |
the units for the new variable |
longname |
the longname for the new variable |
overwrite |
logical overwrite existing variable data |
## Not run:
sim_folder <- run_example_sim(verbose = FALSE)
nc_file <- file.path(sim_folder, 'output/output.nc')
convert_sim_var(nc_file, tempF = temp/5*9+32, unit='degF',longname='temperature degrees Farenheit')
plot_var(nc_file, 'tempF')
convert_sim_var(nc_file, crazy_var = temp-u_mean*1000)
plot_var(nc_file, 'crazy_var')
temp2f <- function(c) c/5*9+32
convert_sim_var(nc_file, tempf = temp2f(temp), unit='degF',longname='temperature degrees Farenheit')
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.