Note_Tech

All technological notes.


Project maintained by simonangel-fong Hosted on GitHub Pages — Theme by mattgraham

R - Vector

Back


Vector


Create Vector

# c() function
x<-c(10.1, 10.2, 33.2)
# 10.1 10.2 33.2
class(x)
# "numeric"

x<-c("shubham","arpita","nishka","vaishali")
class(x)
# "character"

# colon(:) operator
x<-1:10
#  1  2  3  4  5  6  7  8  9 10
x<-10:1
# 10  9  8  7  6  5  4  3  2  1


# seq() function
x<-seq(1,4,by=0.5)
# 1.0 1.5 2.0 2.5 3.0 3.5 4.0
class(x)  # "numeric"

TOP