nestedList2List.Rd
Converts a nested list into a list (and vice versa).
nestedList2List(nestedList)
List2nestedList(List, N_between, N_within=NULL, loop_within=TRUE)
A nested list
A list
Number of between list elements
Number of within list elements
Optional logical indicating whether looping should start from within list
A list or a nested list
if (FALSE) {
#############################################################################
# EXAMPLE 1: List conversions using a small example
#############################################################################
# define a nestedList
nestedList <- as.list(1:3)
nestedList[[1]] <- as.list( 2:4 )
nestedList[[2]] <- as.list( 34 )
nestedList[[3]] <- as.list( 4:9 )
# convert a nested list into a list
v2 <- miceadds::nestedList2List( nestedList)
## reconvert list v2 into a nested list, looping within first
v3 <- miceadds::List2nestedList(v2, N_between=5)
# looping between first
v4 <- miceadds::List2nestedList(v2, N_between=5, loop_within=FALSE)
}