You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this section, it's mentioned that To represent an empty vector (a vector of length zero) of arbitrary type. For example, if you use c() but don’t include any arguments, you get NULL. Below is what I understand, please correct me if I'm wrong.
If we use vector(length=0L), which is used to generate the vector, it returns a logical vector with length 0. And if we use is.null(vector()), the output is FALSE, which shows that the empty vector in R is not NULL.
c() can not only generate the atomic vector or the list. As noted in the R Documentation of c(), With no arguments the value is NULL. The result generated by c() is NULL. And we cannot say that because c() generates NULL, NULL is an empty vector.
Thank you in advance for anyone's suggestion!
The text was updated successfully, but these errors were encountered:
In this section, it's mentioned that To represent an empty vector (a vector of length zero) of arbitrary type. For example, if you use c() but don’t include any arguments, you get NULL. Below is what I understand, please correct me if I'm wrong.
If we use
vector(length=0L)
, which is used to generate the vector, it returns a logical vector with length 0. And if we useis.null(vector())
, the output is FALSE, which shows that the empty vector in R is not NULL.c()
can not only generate the atomic vector or the list. As noted in the R Documentation ofc()
, With no arguments the value is NULL. The result generated byc()
is NULL. And we cannot say that becausec()
generates NULL, NULL is an empty vector.Thank you in advance for anyone's suggestion!
The text was updated successfully, but these errors were encountered: