c() (vector)
Collection of ordered values.
Syntax
v <- c(a, b, c); v[1]; length(v)
Description
Vectors are created with c(). CAUTION: R is 1-indexed — the first element is v[1]. length() gives the number of elements. To append, use v <- c(v, yeni).
Example
Loading editor…
Expected output
1 3
When to use?
Data series, measurements, categories.
Common mistakes
- ⚠️ The first element is v[1], not v[0] (1-indexed).