firstrow_to_vars: firstrow_to_vars function

View source: R/format.R

firstrow_to_varsR Documentation

firstrow_to_vars function

Description

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

Usage

firstrow_to_vars(df, removefirstrow = TRUE, reset_rownames = TRUE)

Arguments

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

Examples

firstrow_to_vars_function()

clmacleod/highlandr documentation built on Oct. 11, 2023, 8:04 p.m.