relist2 | R Documentation |
reshapes a vector according to a list template
relist2(v, l)
v |
vector, probably numeric, of values to reshape |
l |
template list giving structure |
attempts to coerce v
into a list with the same
structure and names as l
a list with values corresponding to v and structure corresponding to l
Ben Bolker
l = list(b=1,c=2:5,d=matrix(1:4,nrow=2))
relist2(1:9,l)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.