Learn R Programming

sfsmisc

The R package sfsmisc has finally made it into a revision control system, and the fad of the day being git & github, so be it!

sfsmisc has been on CRAN for a very long time, and containing R code that is up to 17.5 years old. (See on how I got this into github, including parts of the long history.)

It is a collection of "goodies" as we used to call these nice utility functions. Whereas the package has been written and maintained by Martin Maechler, really there are quite a few more members of the SfS (Seminar fuer Statistik at ETH Zurich) who have authored some of the functions or contributed to them.

DESCRIPTION

Useful utilities 'goodies' from Seminar fuer Statistik ETH Zurich, quite a few related to graphics; many ported from S-plus times.

Copy Link

Version

Install

install.packages('sfsmisc')

Monthly Downloads

11,491

Version

1.1-21

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Martin Maechler

Last Published

July 26th, 2025

Functions in sfsmisc (1.1-21)

diagDA

Diagonal Discriminant Analysis
capture.and.write

Capture output and Write / Print First and Last Parts
compresid2way

Plot Components + Residuals for Two Factors
col01scale

Matrix Scaling Utilities
cum.Vert.funkt

Kumulative Verteilung Aufzeichnen
eaxis

Extended / Engineering Axis for Graphics
ecdf.ksCI

Plot Empirical Distribution Function With 95% Confidence Curves
digitsBase

Digit/Bit Representation of Integers in any Base
diagX

The “Other” Diagonal Matrix
ellipsePoints

Compute Radially Equispaced Points on Ellipse
funEnv

List-like Environment of Functions (and More)
gcd

Greatest Common Divisor and Least Common Multiple
mat2tex

Produce LaTeX commands to print a matrix
missingCh

Has a Formal Argument been Set or is it Missing?
histBxp

Plot a Histogram and a Boxplot
integrate.xy

Cheap Numerical Integration through Data Points
inv.seq

Inverse seq() -- Short Expression for Index Vector
f.robftest

Robust F-Test: Wald test for multiple coefficients of rlm() Object
lseq

Generate Sequences, Equidistant on Log Scale
factorize

Prime Factorization of Integers
is.whole

Test Whether a Vector or Array Consists of Whole Numbers
mpl

Simple Matrix Plots
nr.sign.chg

Number of Sign Changes in Sequence
last

Get Last Elements of a Vector
empty.dimnames

Empty Dimnames of an Array
n.code

Convert "Round" Integers to Short Strings and Back
errbar

Scatter Plot with Error Bars
iterate.lin.recursion

Generate Sequence Iterating a Linear Recursion
p.ts

plot.ts with multi-plots and Auto-Title -- on 1 page
nearcor

Find the Nearest Proper Correlation Matrix
plotStep

Plot a Step Function
p.profileTraces

Plot a profile.nls Object With Profile Traces
p.tachoPlot

Draw Symbol on a Plot
n.plot

Name Plot: Names or Numbers instead of Points in Plot
p.res.2fact

Plot Numeric (e.g. Residuals) vs 2 Factors Using Boxplots
loessDemo

Graphical Interactive Demo of loess()
linesHyperb.lm

Plot Confidence or Prediction Hyperbolas around a Regression Line
ps.latex

PostScript/PDF Preview Device with Optional ‘LaTeX’ Touch
plotDS

Plot Data and Smoother / Fitted Values
potatoes

Fisher's Potato Crop Data
quadrant

Give the Quadrant Number of Planar Points
mult.fig

Plot Setup for MULTiple FIGures, incl. Main Title
pkgDesc

Version of packageDescription() as Simple Vector
hatMat

Hat Matrix of a Smoother
helppdf

help() Type="pdf" and View It
polyn.eval

Evaluate Polynomials
pretty10exp

Nice 10 ** k Label Expressions
seqXtend

Sequence Covering the Range of X, including X
u.Datumvonheute

Datum und Uhrzeit (auf deutsch)
toLatex.numeric

LaTeX or Sweave friendly Formatting of Numbers
sessionInfoX

Extended Information About the Current R Session
posdefify

Find a Close Positive Definite Matrix
p.datum

Plot 'Datum' (deutsch!) unten rechts
sfsmisc-defunct

Defunct Functions in Package sfsmisc
paste.vec

Utility for 'Showing' S vectors
shortRversion

Short R Version String
p.arrows

Prettified Arrows Plots
roundfixS

Round to Integer Keeping the Sum Fixed
rot2

Rotate Planar Points by Angle
signi

Rounding to Significant Digits
prt.DEBUG

Utility Printing in DEBUG mode
u.log

(Anti)Symmetric Log High-Transform
tapplySimpl

More simplification in tapply() result
rrange

Robust Range using Boxplot 'Quartiles'
u.sys

'Portable' System function (R / S-plus)
list_named

Automatically Named list()
xy.grid

Produce Regular Grid Matrix
u.date

Return Date[-Time] String in 'European' Format
ps.end

Close PostScript or Acrobat Graphics Device opened by 'ps.do' / 'pdf.do'
xy.unique.x

Uniqify (X,Y) Values using Weights
p.hboxp

Add a Horizontal Boxplot to the Current Plot
p.dnorm

Plot Parametric Density Functions
tkdensity

GUI Density Estimation using Tcl/Tk
p.scales

Conversion between plotting scales: usr, cm, symbol
u.datumdecode

Convert “Numeric” Dates
u.assign0

'Portable' assign / get functions (R / S-plus) for 'Frame 0'
read.org.table

Read.table for an Emacs Org Table
sourceAttach

Source and Attach an R source file
p.res.2x

Stahel's Residual Plot against 2 X's
relErr

Relative Error When Appropriate, Absolute Otherwise
str_data

Overview on All Datasets in an R Package
repChar

Make Simple String from Repeating a Character, e.g. Blank String
printTable2

Add and Print Marginals for 2-way Contingency Tables
u.boxplot.x

Utility Returning x-Coordinates of Boxplot
vcat

Paste Utilities -- Concatenate Strings
primes

Find all Primes Less Than n
wrapFormula

Enhance Formula by Wrapping each Term, e.g., by "s(.)"
rotn

Generalized Rot13 Character Translation (Rotation)
unif

Nice Uniform Points in Interval
uniqueL

A Reversable Version of unique()
D2ss

Numerical Derivatives of (x,y) Data (via Smoothing Splines)
Duplicated

Counting-Generalization of duplicated()
KSd

Approximate Critical Values for Kolmogorov-Smirnov's D
AsciiToInt

Character to and from Integer Codes Conversion
D1D2

Numerical Derivatives of (x,y) Data via Smoothing Splines
cairoSwd

Cairo PDF Graphics Device useful for Sweave
axTexpr

Axis Ticks Expressions in Nice 10 ** k Form
Deprecated

Deprecated 'sfsmisc' Functions
TA.plot

Tukey-Anscombe Plot (Residual vs. Fitted) of a Linear Model
QUnif

Quasi Randum Numbers via Halton Sequences