Explanation about vectors

##### Title

##### Question

why we need vectors here ? what are its applications? is it like array?

R Introduction-to-basics-of-R 06-07 min 40-50 sec

__Answers:__

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.

As in C the elementary data types are int, char, float etc. similarly there is vector in R. A vector is a constituent of an array and can be of integer type, character type, logical type and so on.

1D array of homogeneous elements is a vector.

2D array of homogeneous elements is a matrix.

Any data structure with more dimensions comes in the category of an array.

Login to add comment