Vector, Array, List and Data Frame in R
Category: R January 4, 2014
Vector, Array, List and Data Frame are 4 basic data types defined in R. Knowing the differences between them will help you use R more efficiently.
1. Vector
All elements must be of the same type.
For example, the following code create two vectors.
4. Date Frame
A data frame is used for storing data tables. It is a list of vectors of equal length.
For example, you can create a date frame by using the following code:
> name age student df = data.frame[name, age, student] > df name age student 1 Mike 20 TRUE 2 Lucy 25 FALSE 3 John 30 TRUERelated posts:
- Java vs. Python [2]: Data Types
- R Write a Date Frame to CSV File
- Initialize an Empty Vector in R
- ArrayList vs. LinkedList vs. Vector