modify_opts: Modify an options list

View source: R/modify_opts.R

modify_optsR Documentation

Modify an options list

Description

harpIO includes a number of functions for creating lists of options for, for example, file formats and transformations. modify_opts allows you to change the values for given options in an already generated options list.

Usage

modify_opts(opts, ..., add_options = FALSE)

Arguments

opts

The options list to be modified.

...

Expressions that give new values for options in opts.

add_options

If add_options = TRUE, options that are not already found in opts will be added to opts. The default is FALSE and will give a warning for each option not found in opts

Details

modify_opts is designed to be used in a pipeline so that an options list can easily be modified. It is particularly useful for modifying options set via, for example, an options set in netcdf_opts.

Value

The input options list with modified options

Examples

# Default value for z_var is "height1" with
# options_set = "met_norway_eps"
netcdf_opts(options_set = "met_norway_eps")

# Change z_var to "height0", keeping all other
# options from options_set = "met_norway_eps"
netcdf_opts(options_set = "met_norway_eps") %>%
  modify_opts(z_var = "height2")

andrew-MET/harpIO documentation built on March 7, 2024, 7:48 p.m.