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

5,304

Version

1.21.2

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Berry Boessenkool

Last Published

March 14th, 2022

Functions in berryFunctions (1.21.2)

approx2

Smart linear NA interpolation
almost.equal

Vectorized testing for near-equality
around

View values around an index
TFtest

Test logical expressions
betaPlot

Beta density plot
berryFunctions-package

Berry's functions
anhang

open the Appendix of Rclick
addFade

Color fade out
addRows

Add n rows to a data.frame
addAlpha

Color transparency
classify

Classification into groups
colPointsHist

Histogram for colPoints
colPoints

Points colored relative to third dimension
ciBand

polygon confidence bands
circle

Draw circle with a given radius
dataStr

str of datasets
createPres

Create .Rnw presentation template
catPal

Categorical color palette
distance

Distance between points
checkFile

check file existence
divPal

Diverging color palette
compareDist

compare distributions
climateGraph

climate graph after Walter and Lieth
getColumn

get column from data.frame
compareFiles

Compare textfiles for equality
funnelPlot

Funnel plots for proportional data
is.error

Check if an expression returns an error
expReg

Exponential regression with plotting
funSource

Source code of a function
legendmt

legend with multiline title
library2

install.package and library
betaPlotComp

Compare beta distributions
l2array

Convert list of arrays to array
createFun

create function framework
convertUmlaut

Convert German Umlaute to ASCII
between

Are values between a and b?
colPointsLegend

Legend for colPoints
logSpaced

Logarithmically spaced points
logHist

Histogram of logarithmic values
lim0

axis limits with one end at zero
gof

GOF measures
combineFiles

Combine Textfiles into one
getName

get the name of an input in nested function calls
linReg

linear regression with plotting
linLogTrans

Animation for transition from linear to logarithmic axis
linLogHist

lin-log transition histogram
exp4p

4-parametric exponential function
dupes

Duplicate lines in file
mReg

Multiple regression
lsc

Linear storage cascade, unit hydrograph
googleLink2pdf

extract pdf link from google search result
groupHist

Histogram for classes
learnVocab

spaced learning
locLine

abline at locator point in graph
locArrow

arrow at locator point in graph
if.error

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

Moving average
l2df

List to data.frame
insertRows

insert rows to data.frame
monthAxis

Label date axis
packagePath

Base path of package
removeSpace

Remove white spaces from strings
seqR

seq with a range argument
monthLabs

Nicely spaced labels along a month
owa

Overwrite argument default lists
seqPal

Sequential color palette
na9

Prepend spaces before na.strings
rainbow2

Rainbow from blue to red
openFile

open file in default application
openPDF

open PDF file with sumatra viewer
movAvLines

Moving average with different window widths
nameSample

Nonrandom character sequence with sample
normTest

Test values for normality of distribution
timer

Timer alarm
traceCall

call stack of a function
newFilename

Create new filename if file already exists
quantileBands

Quantile bands
normPlot

Normal density plot
sortDF

sort dataframes by column
quantileMean

Average of R's quantile methods
smoothLines

draw smoothed lines
popleaf

create leaflet popup box info
textField

Write text to plot with halo underneath
pretty2

Truncated pretty breakpoints
timeAxis

Label date axis
sumatraInitialize

Set useful Sumatra PDF Viewer default settings
round0

Round numbers with leading and trailing zeros
superPos

superposition of discharge, unit hydrograph
runTime

runnning time conversion
rescale

shift and scale a vector
horizHist

Horizontal histogram
seasonality

Seasonality analysis
headtail

head and tail
locatorRS

locator with immediate points in Rstudio
spiralDateAnim

Animated spiral graph
spiralDate

Spiral graph of time series
logAxis

Label logarithmic axes
lsMem

Show memory size of objects in MB
logVals

Create log-axis values and labels
yearPlot

annual plot
yearSample

Nonrandom year with sample
parallelCode

code chunk for parallelization
showPal

show color palettes
pdfpng

Create pdf and png graph
normalizePathCP

normalizePath Cross Platform
smallPlot

Inset small plot within figure
par_sapply

cross-platform parallel processing with progbar
runAxis

Label axis with typical running times
roundedRect

Rectangles with rounded corners
truncMessage

truncate message parts
panelDim

Arrange panels in a multipanel plot (par mfrow)
tableColVal

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

try an expression, returning the error stack
unitHydrograph

Unit Hydrograph
testExamples

Test examples in a package
write.tab

write table with different defaults