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

namedrop

drop unneeded names from list elements


Description

goes through a list (containing a combination of single- and multiple-element vectors) and removes redundant names that will make trouble for mle

Usage

namedrop(x)

Arguments

x

a list of named or unnamed, typically numeric, vectors

Details

examines each element of x. If the element has length one and is a named vector, the name is removed; if length(x) is greater than 1, but all the names are the same, the vector is renamed

Value

the original list, with names removed/added

Author(s)

Ben Bolker

Examples

x = list(a=c(a=1),b=c(d=1,d=2),c=c(a=1,b=2,c=3))
names(unlist(namedrop(x)))
names(unlist(namedrop(x)))

bbmle

Tools for General Maximum Likelihood Estimation

v1.0.23.1
GPL
Authors
Ben Bolker [aut, cre], R Development Core Team [aut], Iago Giné-Vázquez [ctb]
Initial release

We don't support your browser anymore

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