import_CTD: Import CTD data from file

View source: R/import_CTD.R

import_CTDR Documentation

Import CTD data from file

Description

Imports CTD data (with all parameters) from a tab-delimited .txt file or a .csv file. The internal CTD website downloads data either as a .txt file or as a ".xls" file, which is actually just a .txt file in disguise. This function uses these data files in their original formats without any external manipulation of the columns or headers. Make sure to download ALL parameters, or else the function will not work correctly. And I repeat: do not change anything in the files before importing! When in doubt, download new files. This function will rename the columns to be nicely formatted for use in R.

Usage

import_CTD(fname)

Arguments

fname

The filename to import, as a string

Details

If you're having trouble and receiving an error about the date format,
try re-downloading the data and NOT editing it in Excel prior to
loading in R. Excel messes up the datetime formatting.

Value

A tibble with imported data and clean column names

Examples


file <- system.file("extdata", "test_CTD_data.txt", package = "kcmarine")
data <- import_CTD(file)

tsparksm/kcmwq documentation built on Sept. 2, 2023, 11:30 p.m.