Learn R Programming

phuse (version 0.2.2)

merge_lists: Compare and merge two lists

Description

compare two lists using the first list as a base; update the values of the first list if the second one has different values; add varibles to the first if they doe not exist in the first list.

Usage

merge_lists(a, b)

Arguments

a

the 1st list

b

the 2nd list

Value

a list containing the merged configuration

Examples

Run this code
# NOT RUN {
  a <- "https://github.com/phuse-org/phuse-scripts/raw/master"
  b <- "development/R/scripts"
  c <- "Draw_Dist1_R.yml"
  f1 <- paste(a,b,c, sep = '/')
  dr <- resolve(system.file("examples", package = "phuse"), "02_display")
  f2 <- paste(dr, "www", "Draw_Dist_R.yml", sep = '/')
  r1 <- read_yml(f1)
  r2 <- read_yml(f2)
  r3 <- merge_lists(r1, r2)
# }

Run the code above in your browser using DataLab