List with Names but Empty Elements in R (Example Code)
In this R tutorial you’ll learn how to create a list with names but without entries.
Example: Construct List Object with Empty Elements
example_list <- sapply(letters[1:3], # Create list function(x) NULL) example_list # Print list # $a # NULL # # $b # NULL # # $c # NULL |
example_list <- sapply(letters[1:3], # Create list function(x) NULL) example_list # Print list # $a # NULL # # $b # NULL # # $c # NULL
Related Tutorials
In addition, you might want to have a look at the related articles on my homepage: