R/frm_append_list.R

Defines functions frm_append_list

## File Name: frm_append_list.R
## File Version: 0.141

frm_append_list <- function(list1, list2, overwrite=TRUE)
{
    list2_names <- names(list2)
    if ( ! overwrite ){
        list1_names <- names(list1)
        list2_names <- setdiff(list2_names, list1_names)
    }
    N2 <- length(list2_names)
    if (N2>0){
        for (nn in 1L:N2){
            list1[[ list2_names[nn] ]] <- list2[[ list2_names[nn] ]]
        }
    }
    return(list1)
}
alexanderrobitzsch/mdmb documentation built on July 18, 2024, 11:14 p.m.