get_vari | R Documentation |
Extracts a selected parameter from the netCDF file and formats it into a dataframe.
get_vari(ncdf, var, incl_time = TRUE, print = TRUE)
ncdf |
filepath; Name of the netCDF file to extract variable |
var |
character; Name of the variable to be extracted. Must match short name in netCDF file |
incl_time |
boolean; Add time to the first column in the dataframe. Defaults to TRUE |
print |
logical; Print the name and units of the variable extracted, defaults to TRUE If coordinates are not in ncdf use print = FALSE |
dataframe in the same format as the observation file with the surface in the top column and the bottom in the last column.
sim_folder <- system.file('extdata', package = 'GOTMr')
run_gotm(sim_folder)
out <- file.path(sim_folder, 'output', 'output.nc')
wtemp <- get_vari(ncdf = out, var = 'temp')
z <- get_vari(ncdf = out, var = 'z')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.