firstrow_to_vars | R Documentation |
given a data frame takes the first row of the data frame and makes it the variable names and then removes the first row. this is useful when using rbind or when an imported dataset doesn't account for headers. duplicative with row_to_var but more optional and less error prone
firstrow_to_vars(df, removefirstrow = TRUE, reset_rownames = TRUE)
df |
a dataframe for which you want to turn the first row into variable names |
removefirstrow |
boolean indicating whether to remove the first row after making it the df variable names. default is TRUE |
reset_rownames |
booelan indicating whether to reset the row names after removing the first row. default is TRUE |
firstrow_to_vars_function()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.