R/frm_append_list.R

Defines functions frm_append_list

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

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 1:N2){
            list1[[ list2_names[nn] ]] <- list2[[ list2_names[nn] ]]
        }
    }
    return(list1)
}

Try the mdmb package in your browser

Any scripts or data that you put into this service are public.

mdmb documentation built on March 7, 2023, 6:58 p.m.