Learn R Programming

⚠️There's a newer version (0.3.9.1) of this package.Take me there.

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

2

Version

0.3.9

License

BSD_3_clause + file LICENSE

Maintainer

Landon Sego

Last Published

November 21st, 2017

Functions in Smisc (0.3.9)

PowerData

An example of power data
df2list

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

A flexible way to import data into R.
cumsumNA

Computes the cummulative sum of a vector without propagating NAs
dfplapply

Parallelized single row processing of a data frame
cusum

Calculates a sequence of Cusum statistics
findDepMat

Identify linearly dependent rows or columns in a matrix
comboList

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

Converts date or datetime strings into alternate formats
factor2character

Converts all factor variables in a dataframe to character variables
cumMax

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

A simple function for converting factors to numeric values
Smisc-package

Smisc: Sego Miscellaneous
hardCode

Facilitate hard coding constants into R
allMissing

Identifies missing rows or columns in a data frame or matrix
hpd

Calculate the highest posterior density credible interval for a unimodal density
as.numericSilent

Convert any vector to numeric, if possible
dkbinom

Probability functions for the sum of k independent binomials
dframeEquiv

Examines the equivalence of two dataframes or matrices
doCallParallel

Call a function with a vectorized input in parallel
signal

Generic for signal
integ

Simple numerical integration routine
getExtension

Get the extension of a vector of filenames
linearMap

Linear mapping of a numeric vector or scalar
parLapplyW

A wrapper for parLapply
getPath

Get the path of a vector of filenames
parseJob

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

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

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

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

Convert a list to a data frame
pvar

Prints the name and value of one or more objects
loadObject

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

Quickly row and column bind many objects together at once
smartTimeAxis

Produces a time axis with smart spacing
plapply

Simple parallelization of lapply
sourceDir

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

Plot one or more functions on a single plot
timeStamp

Embeds the present datetime into a file name
openDevice

Opens a graphics device based on the filename extension
stopifnotMsg

Check multiple conditions and return coresponding error messages
stripExtension

Remove the extension of a vector of filenames
padZero

Pad a vector of numbers with zeros
vertErrorBar

Draw vertical error bar(s) on a plot
rma

Remove all objects from the global environment
select

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

Approximate the integral of a vector of data over time
pcbinom

A continuous version of the binomial cdf
timeIt

Times the execution of an expression
pddply

Parallel wrapper for plyr::ddply
timeDiff.eg

Four short time series
stripPath

Remove the path from a vector of filenames
smartFilter

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

Generic data frame with a time variable
smartRbindMat

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

Validate selected elements from a character vector
sepList

Separate a list into distinct objects
timeDiff

Subtracts two time series by matching irregular time indexes
umvueLN

Computes UMVUEs of lognormal parameters