Combine values into a vector

R always creates lists of values—even when there is only one value in a list. These lists are called vectors and they make working with data much easier.

  • Everything is a vector
  • Get to know different data types in R
  • Learn how to create vectors
  • Use the : operator to create numeric sequences
  • Use the concatenate function c() to create vectors of different data types
1:100
c(1, 2, 3, 4)
c("abc", "def", "ghi")
c(TRUE, FALSE, TRUE)
View Interactive Version
Combine values into a vector