importPeakFQ: Import Data from PeakFQ Output

Description Usage Arguments Details Value Examples

View source: R/importPeakFQ.R

Description

The importPeakFQ function reads output directly from PeakFQ and prepares it for use in WREG-R.

Usage

1
importPeakFQ(pfqPath, gisFile, sites = "")

Arguments

pfqPath

A directory that contains all of PeakFQ files for each site in the GIS file. Files can be contained in the main path or in subdirectories of pfqPath. Each site should be represented by one and only one .EXP and .PRT file. (NOTE: importPeakFQ_oneFile is provided to parse EXPs and PRTs that contain more than one site.)

gisFile

A tab-delimited text file that contains a matrix whose rows represent the sites and contains columns that include ‘Station.ID’, ‘Lat’, ‘Long’ and any other variables to be used for analysis.

sites

(optional) A vetor of sites that should be return. Allows for data subsetting. Gage IDs will be checked to ensure that they are an even number of characters. If the length of an idea is an odd number of characters, a leading zero is appended.

Details

This functions allows users to read output directly from PeakFQ without the need to manipulate additional files. The site selection is driven by the sites in the GIS table. Given the large variability of outputs from PeakFQ, based on user inputs, this is a fragile function; spot checks are recommended.

Value

All outputs are returned as part of a list. The list includes:

sites

A vector of site IDs.

Y

A matrix whose comlumns represent unique frequency events, while the row represent particular sites in the same order as sites.

AEP

A vector of annual exceedance probabilities associated with the columns of Y.

X

A matrix whose columns represent basin characteristics to be used as dependent variables and whose rows represent sites corresponding to sites.

LP3f

A matrix containing the fitted LP# parameters that are fixed across exceedence probability. These include the standard deviation, skew and regional skew for each site.

LP3k

A matrix of the fitted kappa parameters of the LP3 distribution for each AEP.

BasChars

A matrix containing the site IDs, latitudes and longitudes.

MSEGR

The mean-squared-error in the regional skew.

recLen

A square matrix indicating the number of overlapping years for each site pair.

recCor

A matrix of the correlaiton between site paris.

Examples

1
2
3
4
5
peakFQdir <- paste0(
  file.path(system.file("exampleDirectory", package = "WREG"),
    "pfqImport"))
gisFilePath <- file.path(peakFQdir, "pfqSiteInfo.txt")
importedData <- importPeakFQ(pfqPath = peakFQdir, gisFile = gisFilePath)

wfarmer-usgs/WREG documentation built on July 24, 2020, 1:28 a.m.