Data Types in R and their Modes - Statistics-and-Machine-Learning-with-R/Statistical-Methods-and-Machine-Learning-in-R GitHub Wiki
Data Types
Click for R-Script
There are several data types depending upon the nature of work one has to do. Following is a list in which you can store data.
Vector
- It contains a sequence of items of the same type. This is most basic structure, e.g. x <- 10 or name <- βHarryβ
Factor
- A Factor is a Categorical Variable.
- A Categorical variable represents types of attributes. e.g. Gender: Male, Female or Flavors of ice cream: Chocolate, Vanilla, Strawberry.
Array
- An Array is a table with βkβ dimensions. Usually used to store data in a table format. If we create an array of dimensions (2,3,4) then 4 rectangular matrices will be created, each with 2 rows and 3 columns.
Source: https://www.tutorialspoint.com/r/r_arrays.htm
Matrix
- A Matrix is an Array, but having specifically two dimensions, e.g. βk=2β.
Data Frame
- A data frame is a table composed with one or several vectors and/or factors all of the same lengths but possibly of different modes. A data frame may contain multiple arrays.
TS β Time Series
- A TS is a Time Series dataset, additionally it contains attributes like frequency and dates.
List
- A list is the ultimate data type to store every element, including vectors, factors, data frames, and even list itself.