cllr_remove_header: A function to find and remove data headers from collar data...

View source: R/cllr_remove_header.R

cllr_remove_headerR Documentation

A function to find and remove data headers from collar data based on the latitude column

Description

A function to find and remove data headers from collar data based on the latitude column

Usage

cllr_remove_header(x, col_nm, rm_header = TRUE, rename_fun = adj_col_nms)

Arguments

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

Details

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 "_".

Value

tibble

Examples

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)

Huh/collar documentation built on Aug. 5, 2022, 11:02 p.m.