path_to_file: Get file path to example data

View source: R/path_to_file.R

path_to_fileR Documentation

Get file path to example data

Description

twriTemplates comes with five bundled example data files in its inst/extdata directory. This function makes them easy to access for practice reading with read.csv() or readr::read_csv().

Usage

path_to_file(file = NULL)

Arguments

file

Name of the file in quotes with extension; "arroyo_swqm.txt", "dissolved_oxygen_raw.csv", "easterwood.csv", "marabwq2021.csv", or "marcewq2021.csv" will work. If NULL, the example files will be listed.

Value

file path

Source

This function is adapted from readxl::readxl_example()

Examples

path_to_file()
path_to_file("easterwood.csv")
head(read.csv(path_to_file("easterwood.csv")))

TxWRI/twriTemplates documentation built on Oct. 20, 2023, 2:06 p.m.