headr: Strip Unit Rows While Importing

Description Usage Arguments Details Value Author(s)

Description

This function reads in a dataset with a header and a unit row ignoring the unit row to preserve data types.

Usage

1
headr(file, header.row = 1, data.start = 3, ...)

Arguments

file

Indicates file location of .csv containing dataset.

header.row

Indicates the row number that the headers are located in. Defaults to 1.

data.start

Indicates the row number that the data begins (i.e. the first non-unit row). Defaults to 3.

Details

This helper function extends the functionality of read.csv by importing headers separately and skipping unit rows located in the specified column. If using read.csv for this, the datatype in each column defaults to character. This function allows the datatype to be inferred during import, which saves time for users who wish to perform calculations on the data once imported without manually typecasting.

Value

file will be imported as a data.frame with the unit rows removed.

Author(s)

Samuel Callisto calli055@umn.edu headr()


callistosp/dataTools documentation built on May 3, 2019, 4:31 p.m.