Irucka Embry's Miscellaneous Functions

A collection of Irucka Embry's miscellaneous functions (Engineering Economics, Civil & Environmental/Water Resources Engineering, Construction Measurements, GNU Octave compatible functions, Python compatible function, Trigonometric functions in degrees and function in radians, Geometry, Statistics, Mortality Calculators, Quick Search, etc.).


iemisc

R package that contains Irucka Embry’s miscellaneous functions:

  • statistical analysis
    • RMS,
    • coefficient of variation (CV),
    • approximate and relative error,
    • range,
    • harmonic mean,
    • geometric mean,
    • maximum mean relative error (MAXRE),
    • and mean relative error (MRE)];
  • engineering economics
    • benefit-cost,
    • future value,
    • present value,
    • annual value,
    • gradients,
    • interest,
    • periods,
    • etc.;
  • geometry
    • polygon area,
    • sphere volume,
    • and right triangle validation;
  • civil & environmental/water resources engineering
    • Concrete Mix Design for Normal Strength & Structural Lightweight Concrete,
    • Construction Measurements with and without Fractions,
    • Engineering Surveying Calculations,
    • Air Stripping,
    • Saturated Vapor Pressure for Ice and Water,
    • Density of Water,
    • Dynamic and Kinematic Viscosity of Water,
    • Specific Gravity and Volume,
    • Unit Weight,
    • Surface Tension of Water,
    • Weighted C Factor,
    • Weighted Curve Number,
    • Darcy friction factor (f),
    • the Reynolds number,
    • Manning's n,
    • Gauckler-Manning-Strickler equations for open channel flow,
    • Modified Rational Method Equation,
    • Linear Surface Area calculation,
    • Rain Garden sizing based on driveways;
  • convert a fraction (or mixed number) to a decimal (numeric vector);
  • negation of chin from data.table and negation of in from base R (%notchin%);
  • quick search (%qsin%);
  • return character vectors in order (%inorder%);
  • mortality rate calculations;
  • proportion solver;
  • sum of all digits in a vector to a single integer;
  • string manipulation (splitcomma and splitremove);
  • a version of linear interpolation for use with NAs;
  • Python compatible floor division function (%//%);
  • GNU Octave/MATLAB compatible trigonometric functions in degrees; and
  • GNU Octave/MATLAB compatible
    • section properties (secprop),
    • remainder (Rem),
    • modulus (Mod_octave),
    • number of dimensions (ndims),
    • row vector (isrow) and column vector (iscolumn) tests,
    • fractional differences (fractdiff),
    • size,
    • numel,
    • and length functions.

This package can be used in academia by students and faulty alike and/or in professional settings.

Installation of iemisc from CRAN

install.packages("iemisc")

Help

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

library(help = "iemisc")

With credit due to Getting Help with R for the following 2 methods of help:

help(shm, package = "iemisc") # sample harmonic mean function help

help(package = "iemisc") # help for the iemisc package

Vignette Viewing

If you wish to browse the iemisc Vignettes, please copy-and-paste the following code into R:

library(iemisc)

utils::browseVignettes("iemisc")

Examples (see more examples in the vignettes and in the functions)


# 1)

install.load::load_package("iemisc", "rando")

set_n(200) # makes the example reproducible

samp <- r_norm(.seed = 200) # sample

# Calculate the sample harmonic mean (SHM) of the 200 values
# Using the default value of na.rm = FALSE
# using a matrix of the numeric vector obs1

samp1 <- matrix(data = samp, nrow = length(samp), ncol = 1, byrow = FALSE,
dimnames = list(c(rep("", length(samp))), "Sample"))

shm(samp1)



# 2)

install.load::load_package("iemisc", "rando")

# Compute the relative error of the 210 values
set_n(210) # makes the example reproducible

true <- r_norm(.seed = 210) # true

approx <- r_norm(.seed = 210) # approximation

relerror(true, approx)



# 3)

library(iemisc)

# Are any of the following right triangles?

righttri(2, 7) # a = 2, b = 7

righttri(a = 4, c = 11)

righttri(b = 4, c = 5)



# 4)

library(iemisc)

# What is the future worth of $2,390.90 in the present 13 years from now with a
# 0.25% interest rate compounded annually?

FgivenP(2390.90, 13, 0.25, frequency = "annual") # the interest rate is 0.25%

Disclaimer

This software is provided “AS IS”. See the GPL License for more information.

License

iemisc is distributed under the GPL-3 (or later) license, as stated in the DESCRIPTION file. For more info, see the GNU General Public License (GPL) page.

Citation

Please refer to the CITATION file for the correct way to cite iemisc.

Donations Accepted

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

Donate using Liberapay

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("iemisc")

1.0.5 by Irucka Embry, 2 years ago


https://gitlab.com/iembry/iemisc


Report a bug at https://gitlab.com/iembry/iemisc/-/issues


Browse source code at https://github.com/cran/iemisc


Authors: Irucka Embry [aut, cre] , Felix Andrews [aut, ctb] (zoo code) , Hans Werner Borchers [aut, ctb] (pracma code) , Samit Basu [aut, ctb] (FreeMat code) , David Bateman [aut, ctb] (GNU Octave code) , Rik Wehbring [aut, ctb] (GNU Octave code) , Didier Clamond [aut, ctb] (MATLAB code) , Berry Boessenkool [aut, ctb] (checkLL and degree functions from OSMscale) , Tyler Rinker [aut, ctb] (lookup and lookup_helper functions from qdapTools) , Colin Caprani [aut, ctb] (secprop MATLAB function) , Teodor Ciuraru [aut, ctb] (stackoverflow R code) , Dylan Russell [aut, ctb] (stackoverflow R code) , John Wallace [aut, ctb] (stackoverflow R code) , kaijagahm [aut, ctb] (R bloggers R code) , Colin B. Macdonald [aut, ctb] (OctSymPy code) , John D Page [aut, ctb] (JavaScript code) , Josh O'Brien [aut, ctb] (stackoverflow R code) , R. van Twisk [aut, ctb] (LibreCAD code)


Documentation:   PDF Manual  


GPL (>= 3) | file LICENSE license


Imports zoo, pracma, iemiscdata, gsubfn, fpCompare, units, stringi, assertthat, rivr, checkmate, chem.databases, methods, ramify, foreach, stats, data.table, measurements, roperators, berryFunctions, round, USA.state.boundaries, sf, ggplot2, ggpubr, matlab, sjmisc, lubridate, anytime, mgsub, geosphere, matlab2r, signal, utils, qdapRegex

Suggests install.load, knitr, import, fractional, fracture, MASS, rmarkdown, tinytest, maps, spelling, sampler, callr, rando, geometry, linguisticsdown, aiRthermo, hydraulics, ie2misc, formatR, pander, printr, tibble, lintr, opencpu


See at CRAN