SHARE
TWEET

Untitled

a guest May 24th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ```{r}
  2. res <- list()
  3. res[["francais"]] <- list(elt1 = "salut", elt2 = "bonjour", elt3 = "au revoir")
  4.  
  5. toadd <- list(elt1 = "hello", elt2 = "good morning", elt3 = "bye")
  6. ```
  7.  
  8. I want to add `toadd` list with name "english" to list `res` :
  9.  
  10. 2 solutions (`c` & `append`):
  11.  
  12. ```{r}
  13. res2 <- c(res, english = list(toadd))
  14. res3 <- append(res, list(english = toadd))
  15.  
  16. identical(res2, res3) # TRUE
  17. ```
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top