set_interpolation_params: Setting interpolation parameters in an interpolator object

View source: R/tidy_interpolator.R

set_interpolation_paramsR Documentation

Setting interpolation parameters in an interpolator object

Description

Changing or updating interpolation parameters in an interpolator object

Usage

set_interpolation_params(
  interpolator,
  params = NULL,
  verbose = getOption("meteoland_verbosity", TRUE)
)

Arguments

interpolator

interpolator object to update

params

list with the parameters provided by the user

verbose

Logical indicating if the function must show messages and info. Default value checks "meteoland_verbosity" option and if not set, defaults to TRUE. It can be turned off for the function with FALSE, or session wide with options(meteoland_verbosity = FALSE)

Details

This function ensures that if no parameters are provided, the default ones are used (see defaultInterpolationParams). Also, if params are partially provided, this function ensures that the rest of the parameters are not changed.

Value

The same interpolator object provided, with the updated interpolation parameters

Author(s)

Victor Granda García, EMF-CREAF

See Also

Other interpolator functions: add_topo(), create_meteo_interpolator(), get_interpolation_params(), read_interpolator(), with_meteo(), write_interpolator()

Examples

# example interpolator
data(meteoland_interpolator_example)
# store the actual parameters
old_parameters <- get_interpolation_params(meteoland_interpolator_example)
# we can provide only the parameter we want to change
meteoland_interpolator_example <- set_interpolation_params(
  meteoland_interpolator_example,
  list(debug = TRUE)
)
# check
get_interpolation_params(meteoland_interpolator_example)$debug
# compare with old
old_parameters$debug
# the rest should be the same
setdiff(old_parameters, get_interpolation_params(meteoland_interpolator_example))


meteoland documentation built on Aug. 21, 2023, 5:10 p.m.