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

repnam

Replicate with names


Description

Function repnam replicates its argument to the desired length, either by simply replicating or - if it has names - by replicating the default and matching the argument by its names.

Usage

repnam(argument, names = NULL, len=length(names), default = list(NULL))

Arguments

argument

a named or non-named vector or list to be replicated

names

NULL or a charcter vector of names to which the argument names are matched

len

the desired length (required if names is not given)

default

the desired default which is replicated in case names are used (the default list(NULL) is suitable for a list argument)

Value

an object like argument or default having length len

Note

This is for internal use, e.g. to handle argument colClasses in read.table.ffdf

Author(s)

Jens Oehlschlägel

See Also

Examples

message("a list example")
 repnam(list(y=c(1,2), z=3), letters)
 repnam(list(c(1,2), 3), letters)

 message("a vector example")
 repnam(c(y=1, z=3), letters, default=NA)
 repnam(c(1, 3), letters, default=NA)

ff

Memory-Efficient Storage of Large Data on Disk and Fast Access Functions

v4.0.4
GPL-2 | GPL-3 | file LICENSE
Authors
Daniel Adler [aut], Christian Gläser [aut], Oleg Nenadic [aut], Jens Oehlschlägel [aut, cre], Martijn Schuemie [aut], Walter Zucchini [aut]
Initial release
2020-10-13

We don't support your browser anymore

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