row_to_names | R Documentation |
Elevate a row to be the column names of a data.frame.
row_to_names(
dat,
row_number,
...,
remove_row = TRUE,
remove_rows_above = TRUE,
sep = "_"
)
dat |
The input data.frame |
row_number |
The row(s) of |
... |
Sent to |
remove_row |
Should the row |
remove_rows_above |
If |
sep |
A character string to separate the values in the case of multiple
rows input to |
A data.frame with new names (and some rows removed, if specified)
Other Set names:
clean_names()
,
find_header()
,
mu_to_u
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.