Learn R Programming

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

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 Clone or Download - Download ZIP (top right, link), 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

1,838

Version

1.20.1

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Berry Boessenkool

Last Published

April 1st, 2021

Functions in berryFunctions (1.20.1)

almost.equal

Vectorized testing for near-equality
TFtest

Test logical expressions
approx2

Smart linear NA interpolation
around

View values around an index
anhang

open the Appendix of Rclick
berryFunctions-package

Berry's functions
addRows

Add n rows to a data.frame
betaPlot

Beta density plot
addAlpha

Color transparency
addFade

Color fade out
catPal

Categorical color palette
climateGraph

climate graph after Walter and Lieth
classify

Classification into groups
checkFile

check file existence
getColumn

get column from data.frame
colPointsHist

Histogram for colPoints
createPres

Create .Rnw presentation template
funnelPlot

Funnel plots for proportional data
colPoints

Points colored relative to third dimension
dataStr

str of datasets
convertUmlaut

Convert German Umlaute to ASCII
createFun

create function framework
if.error

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

get the name of an input in nested function calls
gof

GOF measures
combineFiles

Combine Textfiles into one
colPointsLegend

Legend for colPoints
dupes

Duplicate lines in file
betaPlotComp

Compare beta distributions
exp4p

4-parametric exponential function
lim0

axis limits with one end at zero
library2

install.package and library
insertRows

insert rows to data.frame
legendmt

legend with multiline title
locatorRS

locator with immediate points in Rstudio
headtail

head and tail
ciBand

polygon confidence bands
logAxis

Label logarithmic axes
linLogHist

lin-log transition histogram
compareDist

compare distributions
googleLink2pdf

extract pdf link from google search result
circle

Draw circle with a given radius
logVals

Create log-axis values and labels
compareFiles

Compare textfiles for equality
movAv

Moving average
lsMem

Show memory size of objects in MB
owa

Overwrite argument default lists
openPDF

open PDF file with sumatra viewer
expReg

Exponential regression with plotting
funSource

Source code of a function
horizHist

Horizontal histogram
locArrow

arrow at locator point in graph
l2df

List to data.frame
movAvLines

Moving average with different window widths
learnVocab

spaced learning
logHist

Histogram of logarithmic values
packagePath

Base path of package
monthAxis

Label date axis
panelDim

Arrange panels in a multipanel plot (par mfrow)
parallelCode

code chunk for parallelization
groupHist

Histogram for classes
monthLabs

Nicely spaced labels along a month
distance

Distance between points
logSpaced

Logarithmically spaced points
spiralDate

Spiral graph of time series
rescale

shift and scale a vector
between

Are values between a and b?
sumatraInitialize

Set useful Sumatra PDF Viewer default settings
superPos

superposition of discharge, unit hydrograph
spiralDateAnim

Animated spiral graph
divPal

Diverging color palette
round0

Round numbers with leading and trailing zeros
is.error

Check if an expression returns an error
smoothLines

draw smoothed lines
mReg

Multiple regression
sortDF

sort dataframes by column
newFilename

Create new filename if file already exists
normPlot

Normal density plot
lsc

Linear storage cascade, unit hydrograph
roundedRect

Rectangles with rounded corners
runAxis

Label axis with typical running times
tableColVal

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

Convert list of arrays to array
pdfpng

Create pdf and png graph
rainbow2

Rainbow from blue to red
linReg

linear regression with plotting
linLogTrans

Animation for transition from linear to logarithmic axis
nameSample

Nonrandom character sequence with sample
locLine

abline at locator point in graph
yearSample

Nonrandom year with sample
na9

Prepend spaces before na.strings
textField

Write text to plot with halo underneath
normalizePathCP

normalizePath Cross Platform
quantileMean

Average of R's quantile methods
timeAxis

Label date axis
runTime

runnning time conversion
quantileBands

Quantile bands
openFile

open file in default application
popleaf

create leaflet popup box info
pretty2

Truncated pretty breakpoints
removeSpace

Remove white spaces from strings
showPal

show color palettes
yearPlot

annual plot
testExamples

Test examples in a package
truncMessage

truncate message parts
seasonality

Seasonality analysis
unitHydrograph

Unit Hydrograph
tryStack

try an expression, returning the error stack
seqR

seq with a range argument
seqPal

Sequential color palette
smallPlot

Inset small plot within figure
traceCall

call stack of a function
timer

Timer alarm