dr_read: Import raw data from water quality instrument

Description Usage Arguments Value Examples

View source: R/dr_read.R

Description

This function imports the raw data from a YSI Sonde 6600 and EXO2 as well as an Onset U24 Conductivity Logger and formats the data set as a tibble. If defineVar is set to TRUE (the default option), units of measurement will not be included in the first observation.

Usage

1
dr_read(file, instrument, defineVar = TRUE, cleanVar = TRUE, case)

Arguments

file

The name of the file which the data are to be read from. Each row of the table appears as one line of the file. If it does not contain an absolute path, the file name is relative to the current working directory.

instrument

Which instruments the data was colected with. Options currently include "Sonde", "EXO", and "HOBO".

defineVar

Logical scalar that determines if the units of measurement are included in the first observation. If they are included, all vectors will be read in as character.

cleanVar

Logical scalar. Should the variable names be cleaned to remove spaces and special characters? This is implemented using the janitor package's clean_names function.

case

Case to convert variable names to, see janitor::clean_names for details

Value

A tibble with the formatted data and the variable types defined if defineVar = TRUE

Examples

1
2
3
4
5
6
## Not run: 
dr_read("data.csv", instrument = Sonde, defineVar = TRUE, cleanVar = TRUE, case = "snake")
dr_read("data.csv", instrument = EXO, defineVar = TRUE, cleanVar = TRUE, case = "lower_camel")
dr_read("data.csv", instrument = HOBO, defineVar = TRUE, cleanVar = TRUE, case = "all_caps")

## End(Not run)

shaughnessyar/driftR documentation built on June 17, 2018, 8:54 p.m.