R
base vector API Reference
R's base vector functions — vectors are the fundamental data structure in R, holding elements of one type.
By EZ4Code Team
vector functions
Base R functions for creating, inspecting and transforming vectors.
length(x) -> integerReturns the number of elements in a vector or list.
Returns: integer
c(...) -> vectorCombines values into a vector or list, coercing to a common type.
Returns: vector
x[i] (subscript)Extracts elements by integer, logical, or character index. Negative indices drop elements.
Returns: vector
sort(x, decreasing = FALSE) -> vectorReturns a sorted copy of the vector.
Returns: vector
unique(x) -> vectorReturns a vector with duplicate elements removed, preserving first occurrences.
Returns: vector
rev(x) -> vectorReturns a copy of the vector with elements in reverse order.
Returns: vector
sum(..., na.rm = FALSE) -> numericReturns the sum of all values. Use na.rm = TRUE to ignore NA values.
Returns: numeric