R/nestedList2List.R

Defines functions nestedList2List

Documented in nestedList2List

## File Name: nestedList2List.R
## File Version: 0.05

###############################################
# converts a nested list into a list
nestedList2List <- function(nestedList)
{
    NB <- length(nestedList)
    # count number of elements
    M <- 0
    for (bb in 1:NB){
        M <- M + length(nestedList[[bb]])
    }
    # create new list object
    list1 <- as.list(1:M)
    vv <- 1
    for (bb in 1:NB){
        NW <- length(nestedList[[bb]])
        for (ww in 1:NW){
            list1[[vv]] <- nestedList[[bb]][[ww]]
            vv <- vv + 1
        }
    }
    return(list1)
}
#################################################
alexanderrobitzsch/miceadds documentation built on June 2, 2024, 10:10 a.m.