startR (version 0.0.1)

NcVarReader: NetCDF Variable Reader for 'startR'

Description

This is an auxiliary variable reader function for NetCDF files, intended for use as parameter file_var_reader in a call to the function Start() in the package 'startR'. This function complies with the input/output interface required by Start() defined in the documentation for the parameter file_var_reader of that function.

This function uses the function NcDataReader() in the package 'startR', which in turn uses NcToArray() in the package 'easyNCDF', which in turn uses nc_var_get() in the package 'ncdf4'.

Usage

NcVarReader(file_path = NULL, file_object = NULL, file_selectors = NULL, 
            var_name = NULL, synonims)

Arguments

file_path

Character string with the path to the data file to read the variable from. See details in the documentation of the parameter file_var_reader of the function Start().

file_object

Open connection to a NetCDF file, optionally with additional header information. See details in the documentation of the parameter file_var_reader of the function Start().

file_selectors

Information on the path of the file to read data from. See details in the documentation of the parameter file_var_reader of the function Start().

var_name

Character string with the name of the variable to be read.

synonims

Named list with synonims for the variable names to look for in the requested file, exactly as provided in the parameter synonims in a call to the function Start(). See details in the documentation of the parameter file_var_reader of the function Start().

Value

A multidimensional data array with the named dimensions, potentially with the attribute 'variables' with additional auxiliary data. See details in the documentation of the parameter file_var_reader of the function Start().

See Also

NcOpener, NcCloser, NcDataReader, NcDimReader

Examples

Run this code
# NOT RUN {
## Check https://earth.bsc.es/gitlab/es/startR for step-by-step examples 
## of Start() that use NcVarReader().
# }

Run the code above in your browser using DataCamp Workspace