View source: R/cllr_remove_header.R
cllr_remove_header | R Documentation |
A function to find and remove data headers from collar data based on the latitude column
cllr_remove_header(x, col_nm, rm_header = TRUE, rename_fun = adj_col_nms)
x |
A dataframe containing collar data |
col_nm |
The unqouted name of any one column in the data frame |
rm_header |
Logical indicating whether to remove header completely, defaults to TRUE |
rename_fun |
Column renaming function |
The argument rm_header is meant to aid in programming scenarios where some files should be left alone and others need the header removed. We are not sure this is actually useful, but thought of the scenario and accommodated it just the same.
Column names are adjusted using a custom function, but the user can pass any function they want to manipulate column names (e.g. make.names). The default removes non-ASCII characters, coerces all characters to lower case and replaces "." with "_".
tibble
ugly_file <- read.csv(
system.file("extdata", "telonics.csv", package = "collar")
)
# The column name needs to be unquoted (Column, not "Column")
# If spaces exist in the column name you may need to use backticks, top left
# on most(?) qwerty keyboards
collar::cllr_remove_header(ugly_file, `GPS Latitude`, rm_header = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.