wrcc_parseData: Parse RAWS data string

View source: R/wrcc_parseData.R

wrcc_parseDataR Documentation

Parse RAWS data string

Description

Raw character data from WRCC are parsed into a tibble. The incoming fileString can be read in directly from WRCC using wrcc_downloadData() or from a local file using readr::read_file().

The type of monitor represented by this fileString is inferred from the column names using wrcc_identifyMonitorType() and appropriate column types are assigned. The character data are then processed, read into a tibble and augmented in the following ways:

  1. Spaces at the beginning and end of each line are removed.

  2. All header lines beginning with ':' are removed.

Usage

wrcc_parseData(fileString = NULL)

Arguments

fileString

character string containing RAWS data

Value

Dataframe of RAWS raw station data.

References

RAWS USA Climate Archive

Examples

## Not run: 
# Fail gracefully if any resources are not available
try({

library(RAWSmet)

tbl <-
  wrcc_downloadData(wrccID = 'WSWA') %>%
  wrcc_parseData()

dplyr::glimpse(tbl)

}, silent = FALSE)

## End(Not run)

MazamaScience/RAWSmet documentation built on May 6, 2023, 6:57 a.m.