Claudia Spannbauer
lst <- list("Moe", NULL, "Curly") lst
[[1]] [1] "Moe" [[2]] NULL [[3]] [1] "Curly"
compact()
purrr
library(purrr) compact(lst)
[[1]] [1] "Moe" [[2]] [1] "Curly"
💫 In R sind NA und NULL nicht dasselbe.
💫 compact() entfernt nur NULL Werte, nicht NAs.