Creating an Empty List in R

Featured Image of creating an empty list

An empty list means it does not contain any elements. An empty list and NULL have a key difference. An empty list means there is a list object with 0 elements, and a NULL list means NULL; it does not have a class “list”. Here are three ways to create an empty list in R: Using … Read more

What is is.array() Function in R

Featured Image of is.array() Function in R

The is.array() is a built-in R function that checks whether an input object is an array. It returns TRUE if it is an array and FALSE otherwise. Syntax is.array(obj) Parameters Name Value obj It is an input object that will be checked for an array object. Visual representation Checking for an array object # Creating … Read more

What is as.vector() Function in R

Featured Image of as.vector() Function in R

The as.vector() function converts an input R object into a vector. The object can be anything like a matrix, array, or factor. The return value is a vector. When you convert the matrix to a vector, it will remove the attributes, such as dimension, to transform into a vector. When you convert a factor to … Read more

What is is.infinite() Function in R

What is is.infinite() Function in R

The is.infinite() function checks each element of a vector or an R object contains infinity. If an element is infinite, the corresponding element in the output vector is TRUE. Otherwise, FALSE.  By default, it handles atomic vectors, but it can also handle other data types. In R, there are two types of infinity: Inf (positive … Read more