row_to_names {janitor} | R Documentation |
Elevate a row to be the column names of a data.frame.
Description
Elevate a row to be the column names of a data.frame.
Usage
row_to_names(dat, row_number, ..., remove_row = TRUE, remove_rows_above = TRUE)
Arguments
dat |
The input data.frame |
row_number |
The row of |
... |
Sent to |
remove_row |
Should the row |
remove_rows_above |
If |
Value
A data.frame with new names (and some rows removed, if specified)
See Also
Other Set names:
clean_names()
,
find_header()
,
mu_to_u
Examples
x <- data.frame(X_1 = c(NA, "Title", 1:3),
X_2 = c(NA, "Title2", 4:6))
x %>%
row_to_names(row_number = 2)
x %>%
row_to_names(row_number = "find_header")
[Package janitor version 2.2.0 Index]