To create an empty list in R, you can use the list()
function.
In this example,
list()
function to create an empty list.empty_list
.empty_list <- list()
print(empty_list)
list()
In this example,
list()
function to create an empty list.empty_list
.length()
function to check the length of the list.empty_list <- list()
print(length(empty_list))
[1] 0
In this tutorial, we learned How to create an Empty List in R language with well detailed examples.