https://github.com/cran/bbmle
Raw File
Tip revision: 2d0dd33284d67f540125d12c432f22906eab36a5 authored by Ben Bolker on 10 February 2007, 00:00:00 UTC
version 0.6
Tip revision: 2d0dd33
relist.Rd
\name{relist}
\alias{relist}
\title{reconstruct the structure of a list}
\description{
  reshapes a vector according to a list template
}
\usage{
relist(v, l)
}
\arguments{
  \item{v}{vector, probably numeric, of values to reshape}
  \item{l}{template list giving structure}
}
\details{
  attempts to coerce \code{v} into a list with the same
  structure and names as \code{l}
}
\value{
  a list with values corresponding to v and structure corresponding to l
}
\author{Ben Bolker}
\examples{
  l = list(b=1,c=2:5,d=matrix(1:4,nrow=2))
  relist(1:9,l)
}
\keyword{misc}
back to top