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

20,105

Version

1.1-25

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Martin Maechler

Last Published

August 3rd, 2026

Functions in sfsmisc (1.1-25)

D1D2

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

Cairo PDF Graphics Device useful for Sweave
AsciiToInt

Character to and from Integer Codes Conversion
axTexpr

Axis Ticks Expressions in Nice 10 ** k Form
Duplicated

Counting-Generalization of duplicated()
KSd

Approximate Critical Values for Kolmogorov-Smirnov's D
D2ss

Numerical Derivatives of (x,y) Data (via Smoothing Splines)
TA.plot

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

Quasi Randum Numbers via Halton Sequences
Deprecated

Deprecated 'sfsmisc' Functions
compact01

Compact Representation of Binary, 0/1 Values
compresid2way

Plot Components + Residuals for Two Factors
cum.Vert.funkt

Kumulative Verteilung Aufzeichnen
capture.and.write

Capture output and Write / Print First and Last Parts
ecdf.ksCI

Plot Empirical Distribution Function With 95% Confidence Curves
digitsBase

Digit/Bit Representation of Integers in any Base
diagDA

Diagonal Discriminant Analysis
diagX

The “Other” Diagonal Matrix
factorize

Prime Factorization of Integers
errbar

Scatter Plot with Error Bars
gcd

Greatest Common Divisor and Least Common Multiple
eaxis

Extended / Engineering Axis for Graphics
ellipsePoints

Compute Radially Equispaced Points on Ellipse
hatMat

Hat Matrix of a Smoother
f.robftest

Robust F-Test: Wald test for multiple coefficients of rlm() Object
iterate.lin.recursion

Generate Sequence Iterating a Linear Recursion
histBxp

Plot a Histogram and a Boxplot
col01scale

Matrix Scaling Utilities
formatN

Compact Numeric Formatting
inv.seq

Inverse seq() -- Short Expression for Index Vector
integrate.xy

Cheap Numerical Integration through Data Points
funEnv

List-like Environment of Functions (and More)
empty.dimnames

Empty Dimnames of an Array
helppdf

help() Type="pdf" and View It
is.whole

Test Whether a Vector or Array Consists of Whole Numbers
linesHyperb.lm

Plot Confidence or Prediction Hyperbolas around a Regression Line
n.code

Convert "Round" Integers to Short Strings and Back
nr.sign.chg

Number of Sign Changes in Sequence
loessDemo

Graphical Interactive Demo of loess()
mat2tex

Produce LaTeX commands to print a matrix
last

Get Last Elements of a Vector
missingCh

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

Generate Sequences, Equidistant on Log Scale
p.arrows

Prettified Arrows Plots
list_named

Automatically Named list()
p.datum

Plot 'Datum' (deutsch!) unten rechts
pkgDesc

Version of packageDescription() as Simple Vector
nearcor

Find the Nearest Proper Correlation Matrix
p.dnorm

Plot Parametric Density Functions
paste.vec

Utility for 'Showing' S vectors
mult.fig

Plot Setup for MULTiple FIGures, incl. Main Title
p.res.2x

Stahel's Residual Plot against 2 X's
p.ts

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

Plot a profile.nls Object With Profile Traces
mpl

Simple Matrix Plots
n.plot

Name Plot: Names or Numbers instead of Points in Plot
p.tachoPlot

Draw Symbol on a Plot
p.hboxp

Add a Horizontal Boxplot to the Current Plot
p.scales

Conversion between plotting scales: usr, cm, symbol
p.res.2fact

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

Evaluate Polynomials
plotDS

Plot Data and Smoother / Fitted Values
printTable2

Add and Print Marginals for 2-way Contingency Tables
plotStep

Plot a Step Function
prt.DEBUG

Utility Printing in DEBUG mode
potatoes

Fisher's Potato Crop Data
primes

Find all Primes Less Than n
posdefify

Find a Close Positive Definite Matrix
pretty10exp

Nice 10 ** k Label Expressions
rotn

Generalized Rot13 Character Translation (Rotation)
quadrant

Give the Quadrant Number of Planar Points
ps.end

Close PostScript or Acrobat Graphics Device opened by 'ps.do' / 'pdf.do'
rot2

Rotate Planar Points by Angle
relErr

Relative Error When Appropriate, Absolute Otherwise
repChar

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

Datum und Uhrzeit (auf deutsch)
toLatex.numeric

LaTeX or Sweave friendly Formatting of Numbers
sessionInfoX

Extended Information About the Current R Session
seqXtend

Sequence Covering the Range of X, including X
ps.latex

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

Robust Range using Boxplot 'Quartiles'
u.datumdecode

Convert “Numeric” Dates
u.date

Return Date[-Time] String in 'European' Format
u.boxplot.x

Utility Returning x-Coordinates of Boxplot
u.assign0

'Portable' assign / get functions (R / S-plus) for 'Frame 0'
u.sys

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

Overview on All Datasets in an R Package
wrapFormula

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

(Anti)Symmetric Log High-Transform
uniqueL

A Reversable Version of unique()
sfsmisc-defunct

Defunct Functions in Package sfsmisc
unif

Nice Uniform Points in Interval
read.org.table

Read.table for an Emacs Org Table
signi

Rounding to Significant Digits
vcat

Paste Utilities -- Concatenate Strings
tkdensity

GUI Density Estimation using Tcl/Tk
sourceAttach

Source and Attach an R source file
tapplySimpl

More simplification in tapply() result
roundfixS

Round to Integer Keeping the Sum Fixed
shortRversion

Short R Version String
xy.grid

Produce Regular Grid Matrix
xy.unique.x

Uniqify (X,Y) Values using Weights