Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

make.par.list

Make a List from a Parameter Specification


Description

Process parameters so that a list of parameter specifications is returned (used by plot.zoo and xyplot.zoo).

Usage

make.par.list(nams, x, n, m, def, recycle = sum(unnamed) > 0)

Arguments

nams

character vector with names of variables.

x

list or vector of parameter specifications, see details.

n

numeric, number of rows.

m

numeric, number of columns. (Only determines whether m is 1 or greater than 1.

def

default parameter value.

recycle

logical. If TRUE recycle columns to provide unspecified ones. If FALSE use def to provide unspecified ones. This only applies to entire columns. Within columns recycling is always done regardless of how recycle is set. Defaults to TRUE if there is at least one unnamed variable and defaults to FALSE if there are only named variables in x.

Details

This function is currently intended for internal use. It is currently used by plot.zoo and xyplot.zoo but might also be used in the future to create additional new plotting routines. It creates a new list which uses the named variables from x and then assigns the unnamed in order. For the remaining variables assign them the default value if !recycle or recycle the unnamed variables if recycle.

Value

A list of parameters, see details.

Examples

make.par.list(letters[1:5], 1:5, 3, 5)
suppressWarnings( make.par.list(letters[1:5], 1:4, 3, 5, 99) )
make.par.list(letters[1:5], c(d=3), 3, 5, 99)
make.par.list(letters[1:5], list(d=1:2, 99), 3, 5)
make.par.list(letters[1:5], list(d=1:2, 99, 100), 3, 5)

zoo

S3 Infrastructure for Regular and Irregular Time Series (Z's Ordered Observations)

v1.8-10
GPL-2 | GPL-3
Authors
Achim Zeileis [aut, cre] (<https://orcid.org/0000-0003-0918-3766>), Gabor Grothendieck [aut], Jeffrey A. Ryan [aut], Joshua M. Ulrich [ctb], Felix Andrews [ctb]
Initial release
2022-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.