setProj: Set Up an ESTREND Project

View source: R/setProj.R

setProjR Documentation

Set Up an ESTREND Project

Description

Define the data and other characteristics of an ESTREND project.

Usage

setProj(project, data, STAID, DATES, Snames, FLOW = NULL, Covars = NULL,
  type = "seasonal", Start = NULL, End = NULL, tol = NULL,
  min.obs = 20)

Arguments

project

the name of the project to set up. The project name is forced to all lower case.

data

the dataset to use in for the project.

STAID

the name of the column in data that contains the station identifiers. The data are forced to character for the analysis.

DATES

the name of the column in data containing the sample dates. This column must be class "Date" for seasonal analyses, but can be numeric or integer for annual analyses.

Snames

the name of the columns in data containing the sample data for trend analysis. These must be of class "numeric," "integer," "lcens," or "qw."

FLOW

the name of the column in data containing the streamflow for each sample.

Covars

the name of the columns in data containing any covariate data for trend analysis.

type

the kind of analysis. Must be "seasonal," "tobit," "annual," or "monthly." Only the fist letter is necessary. See Details.

Start

the starting date for the analysis. For seasonal analyses, must be "Date" or a character string the represents a date. For annual analyses, must match the type of DATES. See Details.

End

the ending date for the analysis. For seasonal analyses, must be "Date" or a character string the represents a date. For annual analyses, must match the type of DATES. To guarantee that the periods are set up correctly, End should be the first day of the month following the actual last day.

tol

the tolerance for the samples dates. To be included in a regular analysis, the first sample within the Start to End time period must be within tol and likewise for the last sample. if tol is NULL, then it is set to 5 percent of the time frame, except for annual series analysis when it is set to 1 year.

min.obs

the minimum number of observations required for a trend analysis.

Details

If Start and End are NULL, then a ragged analysis is set up, and each variable set up for each station is analyzed on the available data. Otherwise, the analysis is regular and will be restricted to the time frame specified by Start and End.

If type is "seasonal," then the data are processed for a seasonal Kendall type of analysis—seasons are defined (12, 6, 4, and 3 per year) and evaluated to select the "best" number of seasons. If, type is "monthly," then the data are processed for a seasonal Kendall type of analysis—seasons defined as months, but the number of seasons is set by the months during which sampling occured. There must be at least 1/2 of possible samples in a month to be included. If type is "tobit" or "annual," then no seasonal analysis is done because the data are ready for analysis. If type is "annual," then the data must be uncensored.

Value

The name of the project is returned.

Note

A directory is created using the name of the project is created in the user's directory. It contains the objects created by restrend as R workspaces.


USGS-R/restrend documentation built on Oct. 11, 2022, 6:10 a.m.