Reads a NetCDF file into a data frame with longitude and latitude information
nc_to_df(
obj,
varnam,
lon = NA,
lat = NA,
do_get_ilon_ilat = FALSE,
dropna = FALSE,
filn = NA,
verbose = FALSE
)
Either character string specifying the NetCDF file path to be read or a object returned by function GECOr::read_nc_onefile() or GECOr::nc_to_df().
A character string specifying the variable name in the NetCDF file.
A numeric vector specifying longitude values. Defaults to NA
.
A numeric vector specifying latitude values. Defaults to NA
.
A boolean specifying whether longitude and latitude
indices are added to the data frame. Defaults to FALSE
.
A boolean specifying wether rows where the data variable is NA should
be dropped. Recommended to be set to TRUE
for large global arrays where much
of the grid is NA (e.g., over ocean).
A character string specifying the file name to which the data frame is
written. If filn = NA
(defaults), the data frame is returned by the function,
otherwise, NULL
is returned.
A boolean specifying whether progress messages should be written to prompt.
A data frame if filn == NA
, otherwise nothing is returned.