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

1,957

Version

1.16.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Berry Boessenkool

Last Published

November 3rd, 2017

Functions in berryFunctions (1.16.0)

berryFunctions-package

Berry's functions
betaPlot

Beta density plot
betaPlotComp

Compare beta distributions
between

Are values between a and b?
distance

Distance between points
divPal

Diverging color palette
getName

get the name of an input in nested function calls
gof

GOF measures
groupHist

Histogram for classes
googleLink2pdf

extract pdf link from google search result
library2

install.package and require
lim0

axis limits with one end at zero
parallelCode

code chunk for parallelization
monthAxis

Label date axis
monthLabs

Nicely spaced labels along a month
pdfpng

Create pdf and png graph
rescale

shift and scale a vector
round0

Round numbers with leading and trailing zeros
textField

Write text to plot with halo underneath
timeAxis

Label date axis
tryStack

try an expression, returning the error stack
unitHydrograph

Unit Hydrograph
combineFiles

Combine Textfiles into one
exp4p

4-parametric exponential function
expReg

Exponential regression with plotting
is.error

Check if an expression returns an error
l2array

Convert list of arrays to array
locLine

abline at locator point in graph
logAxis

Label logarithmic axes
logVals

Create log-axis values and labels
lsMem

Show memory size of objects in MB
newFilename

Create new filename if file already exists
normPlot

Normal density plot
seqPal

Sequential color palette
seqR

seq with a range argument
superPos

superposition of discharge, unit hydrograph
tableColVal

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

Timer alarm
toupper1

capitalize words
addAlpha

Color transparency
classify

Classification into groups
climateGraph

climate graph after Walter and Lieth
dataDWD

dataDWD and readDWD are now in 'rdwd'.
TFtest

Test logical expressions
almost.equal

Vectorized testing for near-equality
dataStr

str of datasets
funSource

Source code of a function
funTinn

Open function in TinnR
insertRows

insert rows to data.frame
instGit

install github package
anhang

open the Appendix of Rclick
colPoints

Points colored relative to third dimension
colPointsHist

Histogram for colPoints
createFun

create function framework
createPres

Create .Rnw presentation template
around

View values around an index
checkFile

check file existence
ci

calculate confidence interval around mean
colPointsLegend

Legend for colPoints
approx2

Smart linear NA interpolation
dupes

Duplicate lines in file
exTime

Time to run examples
headtail

head and tail
horizHist

Horizontal histogram
addFade

Color fade out
addRows

Add n rows to a data.frame
ciBand

polygon confidence bands
circle

Draw circle with a given radius
compareFiles

Compare textfiles for equality
linLogHist

lin-log transition histogram
linLogTrans

Animation for transition from linear to logarithmic axis
na9

Prepend spaces before na.strings
logHist

Histogram of logarithmic values
logSpaced

Logarithmically spaced points
lsc

Linear storage cascade, unit hydrograph
mReg

Multiple regression
convertUmlaut

Convert German Umlaute to ASCII
funnelPlot

Funnel plots for proportional data
getColumn

get column from data.frame
nameSample

Nonrandom character sequence with sample
popleaf

create leaflet popup box info
pretty2

Truncated pretty breakpoints
runAxis

Label axis with typical running times
l2df

List to data.frame
legendmt

legend with multiline title
linReg

linear regression with plotting
locArrow

arrow at locator point in graph
packagePath

Base path of package
panelDim

Arrange panels in a multipanel plot (par mfrow)
quantileBands

Quantile bands
traceCall

call stack of a function
truncMessage

truncate message parts
movAv

Moving average
movAvLines

Moving average with different window widths
openFile

open file in default application
owa

Overwrite argument default lists
seasonality

Seasonality analysis
spiralDate

Spiral graph of time series
spiralDateAnim

Animated spiral graph
rainbow2

Rainbow from blue to red
removeSpace

Remove white spaces from strings
smoothLines

draw smoothed lines
sortDF

sort dataframes by column
quantileMean

Average of R's quantile methods
yearSample

Nonrandom year with sample
showPal

show color palettes
smallPlot

Inset small plot within figure