The is.list()
function in R returns a logical value, TRUE
or FALSE
, that indicates whether an argument passed to it is a list
.
To understand what a list in R is, we can check out this shot.
is.list(x)
The is.list()
function takes a single parameter value, x
. This represents the R object to be checked.
The is.list()
function returns a logical value (TRUE
or FALSE
).
# Creating R objectsHeight1 <- factor(c("Tall", "Average", "Short"))Height2 <- list(c("Tall", "Average", "Short"))# Testing if the object are listsis.list(Height1)is.list(Height2)
Height1
using the factor()
function.Height2
using the list()
function.Height1
is a list by using the is.list()
function.Height2
is a list by using the is.list()
function.