data.frame API Reference
R's data.frame — a tabular structure of rows and columns, the workhorse of base R data analysis.
data.frame functions
Base R functions for creating and manipulating data frames.
data.frame(...) -> data.frameCreates a data frame from named vectors or columns, with stringsAsFactors defaulting to FALSE.
Returns: data.frame
nrow(x) -> integerReturns the number of rows in a data frame or matrix.
Returns: integer
ncol(x) -> integerReturns the number of columns in a data frame or matrix.
Returns: integer
x[i, j] (subset)Extracts rows i and columns j from a data frame. Either may be omitted to select all.
Returns: data.frame|vector
x$col (column access)Extracts a single column by name from a data frame, returning it as a vector.
Returns: vector
rbind(...) -> data.frameCombines data frames or vectors by rows (stacking vertically). Columns must match.
Returns: data.frame
cbind(...) -> data.frameCombines objects by columns (side by side). Rows must match in length.
Returns: data.frame