Factors in R are data structures for representing categorical variables i.e. data which can assume only finite number of distinct values. Although it is possible to store such data in any of the data structures that we have already covered, viz. vectors, matrices, arrays, lists and data frames, doing so will not take advantage of […]

## Basic Data Structures V: Arrays in R

What are Arrays in R? Arrays in R are multidimensional (sometimes called n-d) data structures that hold members of a single data type. From an implementation point of view, an array is a vector that has one or two additional attributes – dim and dimnames. Only dim attribute is mandatory for an array. Another way […]

## Basic Data Structures IV: Lists in R

What are Lists in R? Lists in R are a collection of heterogeneous data types. Therefore, lists in R can contain elements of different types. One way of viewing lists in R is to perceive them as vectors that don’t care (at least while adding elements) about the types of its members. Yet another way […]