powered by
This function allows combining two vectors or lists without duplicating common content (definded by name of list-elements).
appendNR(x, y, rmDuplicate = TRUE, silent = FALSE, callFrom = NULL)
If both x and y are vectors, the output will be a vector, otherwise it will be a list
x
y
(vector or list) must have names to allow checking for duplicate names in y
(vector or list) must have names to allow checking for duplicate names in x
(logical) avoid duplicating liste-elements present in both x and y (based on names of list-elements)
(logical) suppress messages
(character) allow easier tracking of message(s) produced
When setting the argument rmDuplicate=FALSE the function will behave like append.
rmDuplicate=FALSE
append
append; lrbind
lrbind
li1 <- list(a=1, b=2, c=3) li2 <- list(A=11, B=12, c=3) appendNR(li1, li2) append(li1, li2)
Run the code above in your browser using DataLab