Posts

Showing posts from June, 2020

Data Structure in R

Image
We will look at five basic data structures that are available in R. Vectors   A vector is the simplest type of data structure in R. Simply put, a vector is a sequence of data elements of the same basic type. Members of a vector are called Components. The elements of a vector are all numbers, giving a numeric vector, or all character values, giving a character vector. A vector can be used to represent a single variable in a data set.   Factors   A collection of values that all come from a fixed set of possible values. A factor is similar to a vector, except that the values within a factor are limited to a fixed set of possible values. A factor can be used to represent a  categorical   variable in a data set.   Matrices   This is a two-dimensional structure (like a data frame), but one where all values are of the same type (like a vector)...