Create Empty List in R with Specific Length
Here we are specifying length in an empty list using the following syntax.
vector(mode='list', length)
where,
- mode specifies the list
- length specifies the length of empty list
Example:
R
# create empty list with length 3 data = vector (mode= 'list' , length=3) print (data) # display length print ( length (data)) |
Output:
[[1]] NULL [[2]] NULL [[3]] NULL [1] 3
How to Create Empty List in R?
In this article, we will discuss how to create an empty list in R Programming Language.
Contact Us