Learn R Programming

intro

Miscellaneous R functions. Notable: colPoints, horizHist, logAxis, pointZoom, smallPlot, lsc.

See the Vignette for an overview of the package.

Recent changes (Thanks, Jenny)

installation

Install release version from CRAN:

install.packages("berryFunctions")
library(berryFunctions)
vignette("berryFunctions")
?berryFunctions

Update to the current development version on github: :

if(!requireNamespace("remotes", quitly=TRUE)) install.packages("remotes")
remotes::install_github("brry/berryFunctions")

trouble

If direct installation from CRAN doesn't work, your R version might be too old. In that case, an update is really recommendable: r-project.org. If you can't update R, try installing from source (github) via instGit or devtools as mentioned above. If that's not possible either, here's a manual workaround: click on Code - Download ZIP (top right), unzip the file to some place, then

setwd("that/path")
dd <- dir("berryFunctions-master/R", full=T)
dummy <- sapply(dd, source)

This creates all R functions as objects in your globalenv workspace (and overwrites existing objects of the same name!).

license

This package is under the GPL license. I am fine with you doing whatever you want with it, provided that my name and credit remains attached to it. If you legally need a more permissive license, let me know and I can probably change it.

Copy Link

Version

Install

install.packages('berryFunctions')

Monthly Downloads

2,472

Version

1.22.13

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Berry Boessenkool

Last Published

July 28th, 2025

Functions in berryFunctions (1.22.13)

catPal

Categorical color palette
checkFile

check file existence
bmap

title
ciBand

polygon confidence bands
betaPlotComp

Compare beta distributions
circle

Draw circle with a given radius
between

Are values between a and b?
bpairs

customized pairs plot
climateGraph

climate graph after Walter and Lieth
classify

Classification into groups
createFun

create function framework
colPointsLegend

Legend for colPoints
colPointsHist

Histogram for colPoints
compareDist

compare distributions
compareFiles

Compare textfiles for equality
colPoints

Points colored relative to third dimension
createPres

Create .Rnw presentation template
dataStr

str of datasets
combineFiles

Combine Textfiles into one
distance

Distance between points
divPal

Diverging color palette
dupes

Duplicate lines in file
count

count string occurrences
getColumn

get column from data.frame
convertUmlaut

Convert German Umlaute to ASCII
horizHist

Horizontal histogram
if.error

expressions/values conditional on whether tested expression returns an error.
is.error

Check if an expression returns an error
funSource

Source code of a function
exp4p

4-parametric exponential function
getName

get the name of an input in nested function calls
insertRows

insert rows to data.frame
expReg

Exponential regression with plotting
headtail

head and tail
library2

install.package and library
googleLink2pdf

extract pdf link from google search result
gof

GOF measures
linReg

linear regression with plotting
locArrow

arrow at locator point in graph
groupHist

Histogram for classes
lim0

axis limits with one end at zero
linLogHist

lin-log transition histogram
learnVocab

spaced learning
legendmt

legend with multiline title
l2array

Convert list of arrays to array
locLine

abline at locator point in graph
funnelPlot

Funnel plots for proportional data
logHist

Histogram of logarithmic values
locatorRS

locator with immediate points in Rstudio
lsMem

Show memory size of objects in MB
logAxis

Label logarithmic axes
lsc

Linear storage cascade, unit hydrograph
monthAxis

Label date axis
mReg

Multiple regression
l2df

List to data.frame
logSpaced

Logarithmically spaced points
nameSample

Nonrandom character sequence with sample
owa

Overwrite argument default lists
openPDF

open PDF file with sumatra viewer
logVals

Create log-axis values and labels
openFile

open file in default application
monthLabs

Nicely spaced labels along a month
normalizePathCP

normalizePath Cross Platform
linLogTrans

Animation for transition from linear to logarithmic axis
quantileMean

Average of R's quantile methods
pretty2

Truncated pretty breakpoints
parallelCode

code chunk for parallelization
normTest

Test values for normality of distribution
par_sapply

cross-platform parallel processing with progbar
rainbow2

Rainbow from blue to red
normPlot

Normal density plot
pdfpng

Create pdf and png graph
newFilename

Create new filename if file already exists
packagePath

Base path of package
movAvLines

Moving average with different window widths
round0

Round numbers with leading and trailing zeros
na9

Prepend spaces before na.strings
movAv

Moving average
quantileBands

Quantile bands
runRversions

Run code in several R versions
runTime

runnning time conversion
runAxis

Label axis with typical running times
panelDim

Arrange panels in a multipanel plot (par mfrow)
seqR

seq with a range argument
seqPal

Sequential color palette
roundedRect

Rectangles with rounded corners
tableColVal

Table with values with value-dependent colored backgrounds in pdf
smoothLines

draw smoothed lines
popleaf

create leaflet popup box info
rescale

shift and scale a vector
removeSpace

Remove white spaces from strings
superPos

superposition of discharge, unit hydrograph
sumatraPaths

Get Sumatra PDF Viewer paths
seasonality

Seasonality analysis
sumatraInitialize

Set useful Sumatra PDF Viewer default settings
spiralDateAnim

Animated spiral graph
spiralDate

Spiral graph of time series
sortDF

sort dataframes by column
testExamples

Test examples in a package
showPal

show color palettes
truncMessage

truncate message parts
tmessage

messages with call trace
smallPlot

Inset small plot within figure
tryStack

try an expression, returning the error stack
yearSample

Nonrandom year with sample
yearPlot

annual plot
timer

Timer alarm
textField

Write text to plot with halo underneath
write.tab

write table with different defaults
timeAxis

Label date axis
traceCall

call stack of a function
unitHydrograph

Unit Hydrograph
anhang

open the Appendix of Rclick
approx2

Smart linear NA interpolation
around

View values around an index
almost.equal

Vectorized testing for near-equality
addRows

Add n rows to a data.frame
addAlpha

Color transparency
TFtest

Test logical expressions
betaPlot

Beta density plot
addFade

Color fade out
berryFunctions-package

Berry's functions