Learn R Programming

ie2misc (version 0.8.6)

psfFileChange: psfFileChange and psfFileChangeBATCH

Description

The .psf file is a script file that records the specifications used to run the USGS PeakFQ program (http://water.usgs.gov/software/PeakFQ/) for a station. psfFileChange and psfFileChangeBATCH modify the original .psf settings.

Usage

psfFileChange(
  file = tk_choose.files(default = "", caption =
    "Select file(s) to open & hold down Ctrl to choose more than 1 file", multi = TRUE,
    filters = matrix(c("Text file", ".psf", "Text file", ".PSF"), 4, 2, byrow = TRUE)),
  interactive = TRUE
)

psfFileChangeBATCH( path = tk_choose.dir(caption = "Select the directory with the .psf files") )

Arguments

file

Input .psf file(s) to change specific SkewSE, GenSkew, and SkewOpt information to be selected through a file dialog.

interactive

If interactive is TRUE, then the user will select the filenames(s) to use for saving with the file dialog. In order to select more than one file, the user must hold down the Ctrl (Control) button while mouse clicking the chosen files. If interactive is FALSE, then the user will select the directory, via the directory dialog, to use for saving and the original filenames will be used.

path

Directory path of .psf files, to be selected through a directory dialog, to change specific SkewSE, GenSkew, and SkewOpt information. The user will be asked where to find the .psf files & then the user will be asked where to save the revised .psf files.

Value

Revised .psf text file(s)

Details

psfFileChange searches for a character vector of patterns (SkewSE, GenSkew, and SkewOpt) in single or multiple .psf file(s) to replace. If the patterns are missing, then the patterns are added to the file(s). This is done for a single file or multiple files that the user selects. Although these changes are currently pre-determined, future versions may allow the user to change particular settings (for example, how outliers are handled).

psfFileChangeBATCH searches for a character vector of patterns (SkewSE, GenSkew, and SkewOpt) in a directory of .psf files to replace. If the patterns are missing, then the patterns are added to the files. This is done in a BATCH mode (whole directory of .psf files). Although these changes are currently pre-determined, future versions may allow the user to change particular settings (for example, how outliers are handled).

Examples

Run this code
# NOT RUN {
# Examples to change (a) .psf file(s) interactively and non-interactively
library("ie2misc")
psfFileChange() # default where interactive = TRUE
# Follow the file dialog instructions


# These are the rows that have been added or changed as a result of this function:

# SkewSE 0.361804179633127
# GenSkew 0.0104293904
# SkewOpt Weighted



psfFileChange(interactive = FALSE)
# Follow the file dialog instructions

# These are the rows that have been added or changed as a result of this function:

# SkewSE 0.361804179633127
# GenSkew 0.0104293904
# SkewOpt Weighted



psfFileChangeBATCH() # Follow the file dialog instructions


# These are the rows that have been added or changed as a result of this function:

# SkewSE 0.361804179633127
# GenSkew 0.0104293904
# SkewOpt Weighted
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab