Learn R Programming

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], engineering economics (benefit-cost, future value, present value, annual value, gradients, interest, periods, etc.), geometry (sphere volume and right triangle), civil & environmental/water resources engineering (Concrete Mix Design for Normal Strength & Structural Lightweight Concrete, Manning's n, Gauckler-Manning-Strickler equation), a version of linear interpolation for use with NAs, GNU Octave/MATLAB compatible trigonometric functions in degrees, & GNU Octave/MATLAB compatible size, numel, and length functions.

Installation

install.packages("iemisc")

Help

With credit due to the matlab package, for a complete list of functions and the package DESCRIPTION file, use R library(help = "iemisc")

https://www.r-project.org/help.html | Getting Help with R help(shm, package = "iemisc") help(package = "iemisc")

Examples (see more examples in the vignette and in the function descriptions)

library("iemisc")
require("stats")


# 1)
set.seed(200) # makes the example reproducible

samp <- rnorm(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)
# Compute the relative error of the 210 values
set.seed(210) # makes the example reproducible
true <- rnorm(210) # true
approx <- rnorm(210) # approximation

relerror(true, approx)



# 3)
# 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)
# 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.

Copy Link

Version

Install

install.packages('iemisc')

Monthly Downloads

324

Version

0.9.9

License

GPL (>= 3) | file LICENSE

Maintainer

Irucka Embry

Last Published

August 2nd, 2020

Functions in iemisc (0.9.9)

CompIntPaid

Compound Interest Paid (Engineering Economics)
AgivenP

Annual value given Present value (Engineering Economics)
EffInt

Effective Interest rate (Engineering Economics)
AgivenFcont

Annual value given Future value [continuous] (Engineering Economics)
FgivenAcont

Future value given Annual value [continuous] (Engineering Economics)
AgivenPcont

Annual value given Present value [continuous] (Engineering Economics)
AgivenF

Annual value given Future value (Engineering Economics)
FgivenA

Future value given Annual value (Engineering Economics)
AgivenG

Annual value given Gradient value (Engineering Economics)
FgivenP

Future value given Present value (Engineering Economics)
FgivenPcont

Future value given Present value [continuous] (Engineering Economics)
PgivenAcont

Present value given Annual value [continuous] (Engineering Economics)
SimpIntPaid

Simple Interest Paid (Engineering Economics)
PgivenA1

Present value for geometric gradient series (Engineering Economics)
PgivenG

Present value given Gradient value (Engineering Economics)
PgivenA

Present value given Annual value (Engineering Economics)
cscd

Cosecant (in degrees) [GNU Octave/MATLAB compatible]
PgivenFivary

"Present equivalent of a series of future cash flows subject to varying interest rates" (Engineering Economics)
cotd

Cotangent (in degrees) [GNU Octave/MATLAB compatible]
PgivenFcont

Present value given Future value [continuous] (Engineering Economics)
ngivenPFi

To Find i Given F, n, and P (Engineering Economics)
Manningcirc

Circular cross-section using the Gauckler-Manning-Strickler equation
PgivenF

Present value given Future value (Engineering Economics)
numel

Number of elements (GNU Octave/MATLAB compatible)
tand

Tangent (in degrees) [GNU Octave/MATLAB compatible]
size

Size of R objects (GNU Octave/MATLAB compatible)
asecd

Inverse secant (in degrees) [GNU Octave/MATLAB compatible]
nc2

Einstein and Banks method for composite Manning's n
igivenPFn

Interest rate given Future value, Number of periods, and Present value (Engineering Economics)
length_octave

Length of R objects (GNU Octave/MATLAB compatible)
nc1

Horton method for composite Manning's n
shm

Harmonic mean
Manningtri

Triangular cross-section for the Gauckler-Manning-Strickler equation
acotd

Inverse cotangent (in degrees) [GNU Octave/MATLAB compatible]
Manningtrap

Trapezoidal cross-section for the Gauckler-Manning-Strickler equation
acosd

Inverse cosine (in degrees) [GNU Octave/MATLAB compatible]
atan2d

"Two-argument arc-tangent" (in degrees) [GNU Octave/MATLAB compatible]
righttri

Right triangle calculations
atand

Inverse tangent (in degrees) [GNU Octave/MATLAB compatible]
rms

Root-mean-square
sind

Sine (in degrees) [GNU Octave/MATLAB compatible]
asind

Inverse sine (in degrees) [GNU Octave/MATLAB compatible]
cv

Coefficient of variation (CV)
iemisc

iemisc: Irucka Embry's miscellaneous functions
Manningrect

Rectangular cross-section for the Gauckler-Manning-Strickler equation
acscd

Inverse cosecant (in degrees) [GNU Octave/MATLAB compatible]
Manningpara

Parabolic cross-section for the Gauckler-Manning-Strickler equation
benefitcost

Benefit-Cost Ratio (Engineering Economics)
approxerror

Approximate error
ranges

Sample range
cosd

Cosine (in degrees) [GNU Octave/MATLAB compatible]
relerror

Relative error
secd

Secant (in degrees) [GNU Octave/MATLAB compatible]
sgm

Geometric mean
n

Manning's n for natural channels
na.interp1

na.interp1
volsphere

Sphere volume
nc3

Lotter method for composite Manning's n
nc4

Krishnamurthy and Christensen method for composite Manning's n