parse_ts_path: Split file path into contents

parse_ts_pathR Documentation

Split file path into contents

Description

Split file path into contents

Usage

parse_ts_path(file_path, out = c("dir_name", "file_name", "version",
  "site_name", "ts_name", "var_src", "var", "src", "database", "sitenum",
  "is_archive", "creation_date"), use_names = length(file_path) > 1)

Arguments

file_path

a valid file path for ts file

out

a character for desired output ('dir_name','file_name', 'site_name', 'ts_name', or any of the out names from parse_ts_name or parse_site_name)

use_names

logical. Should the return vector be named according to the input values?

Value

a character

Examples

parse_ts_path(c("nwis_08062500-ts_doobs_nwis.rds","nwis_83105638-ts_doobs_nwis.rds"))
parse_ts_path("nwis_08062500-ts_doobs_nwis.tsv.gz")
parse_ts_path("ARCHIVE_20160402170237-nwis_08062500-ts_doobs_nwis.tsv.gz")
parse_ts_path("temp/1/ARCHIVE_20160402170237-nwis_08062500-ts_doobs_nwis.tsv.gz")
parse_ts_path(c('ARCHIVE_20160324120400-nwis_05406479-ts_doobs_nwis.tsv.gz', 
  'temp/nwis_05406480-ts_doobs_nwis.tsv.gz'), use_names=TRUE)

USGS-R/mda.streams documentation built on June 3, 2023, 8:43 a.m.