Here is a list of R:
list1 <- list(var1=1,var2=list(var21=1,var22=2,var23=list(var231=1,var232=0)))
Here is another list of R:
list2 <- list(var1=3,var2=list(var22=0,var23=list(var232=1,var233=2)),var3=list(var31=1))
Now I want to update list1 to list2 , which should include updating existing values ββand introducing new values. As a result, var1 , var22 , var232 should be updated to the value specified in list2 , and var233 , var3 , var31 should be entered as new entries. Therefore, the updated list should look like this:
list(var1=3,var2=list(var21=1,var22=0,var23=list(var231=1,var232=2,var233=2)),var3=list(var31=1))
It is very similar to the default settings and user settings. The default settings must be loaded and updated using custom settings. In my use, I simply create the R list from the JSON file ( default.json ) as the default parameters and want to update the default settings with another list created by another JSON file ( user.json ), as many programs do.
Is there an existing package or some simple / decent way to do this?
source share