c: Create a vector

View source: R/c.R

cR Documentation

Create a vector

Description

Combine elements to form a vector.

Details

c(...)

See Also

Other R data structures: tibble(), list()

Examples

# A numeric vector of length 4:

c(1, 8, 7, 5)

#> [1] 1 8 7 5

-----------------------------------

# A character vector of length 3:

c("apple", "banana", "economics")

#> [1] "apple" "banana" "economics"

-----------------------------------

# A logical vector of length 5:

c(TRUE, FALSE, FALSE, TRUE, FALSE)

#> [1] TRUE FALSE FALSE TRUE FALSE

-----------------------------------

# Vectors can even be combined:

c(1, 2, c(3, 4), c(5, 6, 7))

#> [1] 1 2 3 4 5 6 7


cobriant/qelp documentation built on July 1, 2022, 7:24 a.m.