https://github.com/cran/bbmle
Revision f48cfa224e7234f4755908e8cc684b31f4a0b132 authored by Ben Bolker on 07 March 2008, 19:26:19 UTC, committed by cran-robot on 07 March 2008, 19:26:19 UTC
1 parent d57d09f
Raw File
Tip revision: f48cfa224e7234f4755908e8cc684b31f4a0b132 authored by Ben Bolker on 07 March 2008, 19:26:19 UTC
version 0.8.5
Tip revision: f48cfa2
namedrop.Rd
\name{namedrop}
\alias{namedrop}
\title{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{
  \item{x}{a list of named or unnamed, typically numeric, vectors}
}
\details{
  examines each element of \code{x}.  If the element has length
  one and is a named vector, the name is removed; if \code{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{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)))
}
\keyword{misc}
back to top