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

relist

reconstruct the structure of a list


Description

reshapes a vector according to a list template

Usage

relist2(v, l)

Arguments

v

vector, probably numeric, of values to reshape

l

template list giving structure

Details

attempts to coerce v into a list with the same structure and names as l

Value

a list with values corresponding to v and structure corresponding to l

Author(s)

Ben Bolker

Examples

l = list(b=1,c=2:5,d=matrix(1:4,nrow=2))
  relist2(1:9,l)

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.