Vector is a basic data structure in R
Type of vectors:
1)character
x<-c("m","a","j","e","d","a")
typeof(x)
## [1] "character"
#or
class(x)
## [1] "character"
2)numeric(double)
y<-c(2,7,8,9,5,1,10,15)
typeof(y)
## [1] "double"
#or
class(y)
## [1] "numeric"
3)integer
z<-c(1L,2L,3L,4L,5L)
typeof(z)
## [1] "integer"
#or
class(z)
## [1] "integer"
4)logical
l<-c(TRUE,FALSE,TRUE,TRUE)
typeof(l)
## [1] "logical"
#or
class(l)
## [1] "logical"
5)complex
m <- c(1+2i, 3i, 4-5i, -12+6i)
typeof(m)
## [1] "complex"
#or
class(m)
## [1] "complex"
6)raw
n<-raw(3)
typeof(n)
## [1] "raw"
#or
class(n)
## [1] "raw"