Learn R Programming

⚠️There's a newer version (1.22.13) 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 from github:

source("https://raw.githubusercontent.com/brry/berryFunctions/master/R/instGit.R")
instGit("brry/berryFunctions")

# or use devtools:
if(!requireNamespace("devtools", quitly=TRUE)) install.packages("devtools")
devtools::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

2,977

Version

1.15.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Berry Boessenkool

Last Published

April 10th, 2017

Functions in berryFunctions (1.15.0)

approx2

Smart linear NA interpolation
around

View values around an index
berryFunctions-package

Berry's functions
betaPlot

Beta density plot
almost.equal

Vectorized testing for near-equality
anhang

open the Appendix of Rclick
TFtest

Test logical expressions
addAlpha

Color transparency
addFade

Color fade out
addRows

Add n rows to a data.frame
colPointsHist

Histogram for colPoints
colPointsLegend

Legend for colPoints
climateGraph

climate graph after Walter and Lieth
convertUmlaut

Convert German Umlaute to ASCII
createFun

create function framework
dataStr

str of datasets
distance

Distance between points
gof

GOF measures
googleLink2pdf

extract pdf link from google search result
l2array

Convert list of arrays to array
l2df

List to data.frame
logSpaced

Logarithmically spaced points
logVals

Create log-axis values and labels
colPoints

Points colored relative to third dimension
divPal

Diverging color palette
dupes

Duplicate lines in file
exTime

Time to run examples
betaPlotComp

Compare beta distributions
checkFile

check file existance
combineFiles

Combine Textfiles into one
compareFiles

Compare textfiles for equality
ci

calculate confidence interval around mean
ciBand

polygon confidence bands
expReg

Exponential regression with plotting
funSource

Source code of a function
getColumn

get column from data.frame
getName

get the name of an input in nested function calls
lim0

axis limits with one end at zero
circle

Draw circle with a given radius
classify

Classification into groups
createPres

Create .Rnw presentation template
dataDWD

dataDWD and readDWD are now in 'rdwd'.
legendmt

legend with multiline title
library2

install.package and require
locArrow

arrow at locator point in graph
locLine

abline at locator point in graph
mReg

Multiple regression
monthAxis

Label date axis
quantileBands

Quantile bands
quantileMean

Average of R's quantile methods
sortDF

sort dataframes by column
spiralDate

Spiral graph of time series
spiralDateAnim

Animated spiral graph
funnelPlot

Funnel plots for proportional data
horizHist

Horizontal histogram
lsMem

Show memory size of objects in MB
lsc

Linear storage cascade, unit hydrograph
popleaf

create leaflet popup box info
pretty2

Truncated pretty breakpoints
funTinn

Open function in TinnR
insertRows

insert rows to data.frame
movAvLines

Moving average with different window widths
na9

Prepend spaces before na.strings
panelDim

Arrange panels in a multipanel plot (par mfrow)
superPos

superposition of discharge, unit hydrograph
seasonality

Seasonality analysis
seqPal

Sequential color palette
traceCall

call stack of a function
truncMessage

truncate message parts
pdfpng

Create pdf and png graph
seqR

seq with a range argument
showPal

show color palettes
linLogHist

lin-log transition histogram
nameSample

Nonrandom character sequence with sample
newFilename

Create new filename if file already exists
rainbow2

Rainbow from blue to red
instGit

install github package
is.error

Check if an expression returns an error
logAxis

Label logarithmic axes
logHist

Histogram of logarithmic values
monthLabs

Nicely spaced labels along a month
movAv

Moving average
rescale

shift and scale a vector
runAxis

Label axis with typical running times
tryStack

try an expression, returning the error stack
unitHydrograph

Unit Hydrograph
yearSample

Nonrandom year with sample
exp4p

4-parametric exponential function
groupHist

Histogramm for classes
headtail

head and tail
linLogTrans

Animation for transition from linear to logarithmic axis
removeSpace

Remove white spaces from strings
smallPlot

Inset small plot within figure
smoothLines

draw smoothed lines
timer

Timer alarm
toupper1

capitalize words
linReg

linear regression with plotting
normPlot

Normal density plot
owa

Overwrite argument default lists
tableColVal

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

Write text to plot with halo underneath