Description Usage Arguments Examples
This is a quick and easy way to read a netcdf file to a data frame. It will read all or a specified list of variables into a data frame. This requires that grid details are clear in the netcdf file, so in some rare cases there will be an error message.
1 2 |
ff |
This is the file to read. |
vars |
A list of variables you want to read in. Character vector. Everything is read in if this is empty. |
na_rm |
Do you want rows with nas to be removed from output? Default is FALSE |
cdo_output |
Do you want to show the cdo output? Set to TRUE in case you want to troubleshoot errors. |
dim_check |
The number of data points in the final data frame that will ask to continue. Set to NULL if you don't want to check. |
1 2 3 4 5 6 7 8 9 10 | # Reading in data from the NOAA World Ocean Atlas sample file.
ff <- system.file("extdata", "woa18_decav_t01_01.nc", package = "rcdo")
# if we simply want to read the data into a tibble, we just need to use nc_read
nc_read(ff)
# By default nc_read reads in all data fields. But we probably just want to subset it
# If we only want to read in specific fields, we can use vars
nc_read(ff, vars = "t_an")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.