Learn R Programming

Smisc

An R package containing a collection of functions for statistical computing, data manipulation, and visualization. You can find package vignettes and documentation here.

To cite:

Sego LH. 2016. Smisc: Sego Miscellaneous. A collection of functions for statistical computing and data manipulation in R. Pacific Northwest National Laboratory. https://pnnl.github.io/Smisc.

To install:

You can install the package from CRAN or from GitHub:

CRAN
install.packages("Smisc")
GitHub

You can install from GitHub using the devtools package, in which case you'll need these prerequistites in order to compile the C code in the Smisc package:

  • Mac: you'll need Xcode
  • Windows: you'll need to install R tools
  • Linux/Unix: compilation should take place automatically

Now do the following in R:

# If devtools is not already installed, do this:
install.packages("devtools") 

# Now install the package
devtools::install_github("pnnl/Smisc")

Acknowledgements:

This package was developed with support from the Signature Discovery Initiative at Pacific Northwest National Laboratory, conducted under the Laboratory Directed Research and Development Program at PNNL, a multiprogram national laboratory operated by Battelle for the U.S. Department of Energy.

Copy Link

Version

Install

install.packages('Smisc')

Monthly Downloads

23

Version

0.3.9.1

License

BSD_3_clause + file LICENSE

Maintainer

Landon Sego

Last Published

April 22nd, 2019

Functions in Smisc (0.3.9.1)

signal

Generic for signal
cusum

Calculates a sequence of Cusum statistics
doCallParallel

Call a function with a vectorized input in parallel
stopifnotMsg

Check multiple conditions and return coresponding error messages
linearMap

Linear mapping of a numeric vector or scalar
integ

Simple numerical integration routine
stripExtension

Remove the extension of a vector of filenames
timeDiff.eg

Four short time series
dkbinom

Probability functions for the sum of k independent binomials
timeDiff

Subtracts two time series by matching irregular time indexes
list2df

Convert a list to a data frame
factor2character

Converts all factor variables in a dataframe to character variables
more

Display the contents of a text file to the R console
movAvg2

Calculate the moving average using a 2-sided, symmetric window
getExtension

Get the extension of a vector of filenames
findDepMat

Identify linearly dependent rows or columns in a matrix
factor2numeric

A simple function for converting factors to numeric values
dfplapply

Parallelized single row processing of a data frame
plapply

Simple parallelization of lapply
dframeEquiv

Examines the equivalence of two dataframes or matrices
formatDT

Converts date or datetime strings into alternate formats
hardCode

Facilitate hard coding constants into R
hpd

Calculate the highest posterior density credible interval for a unimodal density
plotFun

Plot one or more functions on a single plot
openDevice

Opens a graphics device based on the filename extension
padZero

Pad a vector of numbers with zeros
smartTimeAxis

Produces a time axis with smart spacing
pcbinom

A continuous version of the binomial cdf
pddply

Parallel wrapper for plyr::ddply
rma

Remove all objects from the global environment
loadObject

Loads and returns the object(s) in one or more ".Rdata" files
select

Select rows or columns from data frames or matrices while always returning a data frame or a matrix
sourceDir

Sources all files with '.R' or '.r' extensions in a directory
timeIntegration

Approximate the integral of a vector of data over time
parLapplyW

A wrapper for parLapply
timeIt

Times the execution of an expression
smartFilter

Calculate a moving dot product (or filter) over a numeric vector
timeStamp

Embeds the present datetime into a file name
parseJob

Parses a collection of elements into (almost) equal-sized groups
selectElements

Validate selected elements from a character vector
smartRbindMat

Row bind matrices whose column names may not be the same
getPath

Get the path of a vector of filenames
grabLast

Get the final set of characters after a single-character delimeter
pvar

Prints the name and value of one or more objects
stripPath

Remove the path from a vector of filenames
qbind

Quickly row and column bind many objects together at once
timeData

Generic data frame with a time variable
sepList

Separate a list into distinct objects
umvueLN

Computes UMVUEs of lognormal parameters
vertErrorBar

Draw vertical error bar(s) on a plot
comboList

Produces all possible combinations of a set of linear model predictors
dataIn

A flexible way to import data into R.
cumMax

Computes the maximum of the vector up to the current index
df2list

Row-wise conversion of a data frame to a list
PowerData

An example of power data
allMissing

Identifies missing rows or columns in a data frame or matrix
as.numericSilent

Convert any vector to numeric, if possible
cumsumNA

Computes the cummulative sum of a vector without propagating NAs
Smisc-package

Smisc: Sego Miscellaneous