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,260

Version

1.22.5

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Last Published

February 16th, 2024

Functions in berryFunctions (1.22.5)

betaPlotComp

Compare beta distributions
almost.equal

Vectorized testing for near-equality
anhang

open the Appendix of Rclick
around

View values around an index
between

Are values between a and b?
addAlpha

Color transparency
addRows

Add n rows to a data.frame
addFade

Color fade out
compareFiles

Compare textfiles for equality
climateGraph

climate graph after Walter and Lieth
convertUmlaut

Convert German Umlaute to ASCII
exp4p

4-parametric exponential function
betaPlot

Beta density plot
circle

Draw circle with a given radius
classify

Classification into groups
expReg

Exponential regression with plotting
divPal

Diverging color palette
dupes

Duplicate lines in file
learnVocab

spaced learning
checkFile

check file existence
legendmt

legend with multiline title
colPoints

Points colored relative to third dimension
combineFiles

Combine Textfiles into one
createFun

create function framework
createPres

Create .Rnw presentation template
compareDist

compare distributions
monthLabs

Nicely spaced labels along a month
bmap

title
logAxis

Label logarithmic axes
groupHist

Histogram for classes
ciBand

polygon confidence bands
headtail

head and tail
movAv

Moving average
logHist

Histogram of logarithmic values
lsMem

Show memory size of objects in MB
linReg

linear regression with plotting
distance

Distance between points
dataStr

str of datasets
gof

GOF measures
normalizePathCP

normalizePath Cross Platform
funSource

Source code of a function
lsc

Linear storage cascade, unit hydrograph
openFile

open file in default application
googleLink2pdf

extract pdf link from google search result
normPlot

Normal density plot
funnelPlot

Funnel plots for proportional data
horizHist

Horizontal histogram
insertRows

insert rows to data.frame
normTest

Test values for normality of distribution
write.tab

write table with different defaults
removeSpace

Remove white spaces from strings
catPal

Categorical color palette
colPointsHist

Histogram for colPoints
colPointsLegend

Legend for colPoints
rescale

shift and scale a vector
showPal

show color palettes
locArrow

arrow at locator point in graph
smallPlot

Inset small plot within figure
textField

Write text to plot with halo underneath
timeAxis

Label date axis
yearPlot

annual plot
timer

Timer alarm
nameSample

Nonrandom character sequence with sample
tmessage

messages with call trace
getColumn

get column from data.frame
getName

get the name of an input in nested function calls
is.error

Check if an expression returns an error
l2array

Convert list of arrays to array
l2df

List to data.frame
newFilename

Create new filename if file already exists
if.error

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

install.package and library
lim0

axis limits with one end at zero
locLine

abline at locator point in graph
linLogHist

lin-log transition histogram
logSpaced

Logarithmically spaced points
linLogTrans

Animation for transition from linear to logarithmic axis
logVals

Create log-axis values and labels
movAvLines

Moving average with different window widths
na9

Prepend spaces before na.strings
locatorRS

locator with immediate points in Rstudio
openPDF

open PDF file with sumatra viewer
quantileMean

Average of R's quantile methods
rainbow2

Rainbow from blue to red
seqPal

Sequential color palette
pretty2

Truncated pretty breakpoints
quantileBands

Quantile bands
runAxis

Label axis with typical running times
runRversions

Run code in several R versions
spiralDate

Spiral graph of time series
seqR

seq with a range argument
pdfpng

Create pdf and png graph
owa

Overwrite argument default lists
tableColVal

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

Animated spiral graph
mReg

Multiple regression
popleaf

create leaflet popup box info
traceCall

call stack of a function
round0

Round numbers with leading and trailing zeros
yearSample

Nonrandom year with sample
testExamples

Test examples in a package
monthAxis

Label date axis
roundedRect

Rectangles with rounded corners
smoothLines

draw smoothed lines
sortDF

sort dataframes by column
tryStack

try an expression, returning the error stack
packagePath

Base path of package
panelDim

Arrange panels in a multipanel plot (par mfrow)
truncMessage

truncate message parts
parallelCode

code chunk for parallelization
par_sapply

cross-platform parallel processing with progbar
runTime

runnning time conversion
seasonality

Seasonality analysis
sumatraInitialize

Set useful Sumatra PDF Viewer default settings
superPos

superposition of discharge, unit hydrograph
unitHydrograph

Unit Hydrograph
berryFunctions-package

Berry's functions
approx2

Smart linear NA interpolation
TFtest

Test logical expressions