MyNixOS website logo
Description
Irucka Embry's Miscellaneous USGS Functions
A collection of Irucka Embry's miscellaneous USGS functions (processing .exp and .psf files, statistical error functions, "+" dyadic operator for use with NA, creating ADAPS and QW spreadsheet files, calculating saturated enthalpy). Irucka created these functions while a Cherokee Nation Technology Solutions (CNTS) United States Geological Survey (USGS) Contractor and/or USGS employee.

ie2misc

R package that contains Irucka Embry’s miscellaneous USGS functions (processing .exp and .psf files, statistical error functions, “+” dyadic operator for use with NA, creating ADAPS and QW spreadsheet files, calculating saturated enthalpy, etc.). Irucka created these functions while a Cherokee Nation Technology Solutions (CNTS) United States Geological Survey (USGS) Contractor and/or USGS employee.

Installation from CRAN

install.packages("ie2misc")

Help

With credit due to the matlab package, for a complete list of functions and the package DESCRIPTION file, use:

library(help = "ie2misc")

Examples

library("ie2misc")
require("stats")

# 1) Calculate the mean-absolute deviation (MAD)
set.seed(1003) # makes the example reproducible

obs1 <- rnorm(1003) # observed

# Using the default value of na.rm = FALSE
# using a matrix of the numeric vector obs1
mat1 <- matrix(data = obs1, nrow = length(obs1), ncol = 1, byrow = FALSE,
dimnames = list(c(rep("", length(obs1))), "Observed"))

madstat(mat1)



# 2) Compute the index of agreement (dr)
set.seed(300) # makes the example reproducible
obs <- rnorm(300) # observed
pre <- rnorm(300) # predicted

# Using the default value of na.rm = FALSE
# using a matrix of the numeric vectors pre and obs
mat <- matrix(data = c(obs, pre), nrow = length(pre), ncol = 2, byrow = FALSE,
dimnames = list(c(rep("", length(pre))), c("Predicted", "Observed")))

dr(mat[, 2], mat[, 1])



# 3) Produce a saturated enthalpy table and direct the output to the console

sat_enthalpy2(elevation = 1810, tbegin = 28, tend = 80, tincrement = 0.1,
output = "console")
# elevation = 120 feet, tbegin = 32 degrees F, tend = 100 degrees F,
# tincrement = 0.1 degrees F



# 4) Create an .xlsx spreadsheet for each of the following water-quality data
# sets (follow the file dialog):

file1 <- "https://waterdata.usgs.gov/nwis/dv?cb_80154=on&format=rdb"
file2 <- "&site_no=03584500&referred_module=sw&period=&begin_date=1904-07-01"
file3 <- "&end_date=2016-06-22"
file4 <- paste0(file1, file2, file3) # used to truncate the file name
qw2(file4)

# USGS 03584500 ELK RIVER NEAR PROSPECT, TN
# Suspended sediment concentration, milligrams per liter (Mean)


file5 <- "https://waterdata.usgs.gov/nwis/dv?cb_80155=on&format=rdb"
file6 <- "&site_no=03584500&referred_module=sw&period=&begin_date=1904-07-01"
file7 <- "&end_date=2016-06-22"
file8 <- paste0(file5, file6, file7) # used to truncate the file name
qw2(file8)

# USGS 03584500 ELK RIVER NEAR PROSPECT, TN
# Suspended sediment discharge, tons per day (Mean)

Disclaimer

This software is in the public domain because it contains materials that originally came from the U.S. Geological Survey, an agency of the United States Department of Interior. For more information, see the official USGS copyright policy

Although this software program has been used by the U.S. Geological Survey (USGS), no warranty, expressed or implied, is made by the USGS or the U.S. Government as to the accuracy and functioning of the program and related program material nor shall the fact of distribution constitute any such warranty, and no responsibility is assumed by the USGS in connection therewith.

This software is provided “AS IS”.

Note: The datasets included in the extdata folder may not have received the USGS’s Director’s approval and thus may still be provisional and subject to revision. The data are included in this package for illustration purposes only. The data are released on the condition that neither the USGS nor the United States Government may be held liable for any damages resulting from its authorized or unauthorized use.

Donations Accepted

If you want to support the continued development of this and my other R packages, feel free to:

Metadata

Version

0.9.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows