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, incl. vignette: :

if(!requireNamespace("remotes", quitly=TRUE)) install.packages("remotes")
remotes::install_github("brry/berryFunctions", build_opts="--no-manual")

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

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Berry Boessenkool

Last Published

May 1st, 2019

Functions in berryFunctions (1.18.2)

TFtest

Test logical expressions
catPal

Categorical color palette
checkFile

check file existence
createFun

create function framework
createPres

Create .Rnw presentation template
expReg

Exponential regression with plotting
approx2

Smart linear NA interpolation
around

View values around an index
funSource

Source code of a function
googleLink2pdf

extract pdf link from google search result
groupHist

Histogram for classes
lsMem

Show memory size of objects in MB
headtail

head and tail
lsc

Linear storage cascade, unit hydrograph
horizHist

Horizontal histogram
openFile

open file in default application
owa

Overwrite argument default lists
yearSample

Nonrandom year with sample
lim0

axis limits with one end at zero
linLogHist

lin-log transition histogram
movAvLines

Moving average with different window widths
classify

Classification into groups
berryFunctions-package

Berry's functions
na9

Prepend spaces before na.strings
popleaf

create leaflet popup box info
betaPlot

Beta density plot
ciBand

polygon confidence bands
circle

Draw circle with a given radius
addFade

Color fade out
divPal

Diverging color palette
pretty2

Truncated pretty breakpoints
addRows

Add n rows to a data.frame
rainbow2

Rainbow from blue to red
betaPlotComp

Compare beta distributions
distance

Distance between points
dataStr

str of datasets
between

Are values between a and b?
colPointsLegend

Legend for colPoints
climateGraph

climate graph after Walter and Lieth
dupes

Duplicate lines in file
tableColVal

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

Test examples in a package
removeSpace

Remove white spaces from strings
tryStack

try an expression, returning the error stack
funnelPlot

Funnel plots for proportional data
combineFiles

Combine Textfiles into one
insertRows

insert rows to data.frame
instGit

install github package
unitHydrograph

Unit Hydrograph
linLogTrans

Animation for transition from linear to logarithmic axis
getColumn

get column from data.frame
linReg

linear regression with plotting
mReg

Multiple regression
monthAxis

Label date axis
packagePath

Base path of package
is.error

Check if an expression returns an error
l2array

Convert list of arrays to array
panelDim

Arrange panels in a multipanel plot (par mfrow)
locArrow

arrow at locator point in graph
locLine

abline at locator point in graph
exTime

Time to run examples
exp4p

4-parametric exponential function
rescale

shift and scale a vector
almost.equal

Vectorized testing for near-equality
anhang

open the Appendix of Rclick
roundedRect

Rectangles with rounded corners
l2df

List to data.frame
learnVocab

spaced learning
logAxis

Label logarithmic axes
round0

Round numbers with leading and trailing zeros
logHist

Histogram of logarithmic values
runAxis

Label axis with typical running times
spiralDateAnim

Animated spiral graph
colPoints

Points colored relative to third dimension
monthLabs

Nicely spaced labels along a month
sortDF

sort dataframes by column
spiralDate

Spiral graph of time series
colPointsHist

Histogram for colPoints
compareFiles

Compare textfiles for equality
convertUmlaut

Convert German Umlaute to ASCII
superPos

superposition of discharge, unit hydrograph
getName

get the name of an input in nested function calls
normPlot

Normal density plot
movAv

Moving average
traceCall

call stack of a function
gof

GOF measures
legendmt

legend with multiline title
library2

install.package and require
logSpaced

Logarithmically spaced points
logVals

Create log-axis values and labels
truncMessage

truncate message parts
nameSample

Nonrandom character sequence with sample
newFilename

Create new filename if file already exists
parallelCode

code chunk for parallelization
normalizePathCP

normalizePath Cross Platform
quantileBands

Quantile bands
quantileMean

Average of R's quantile methods
pdfpng

Create pdf and png graph
seasonality

Seasonality analysis
seqPal

Sequential color palette
smallPlot

Inset small plot within figure
seqR

seq with a range argument
smoothLines

draw smoothed lines
timer

Timer alarm
showPal

show color palettes
textField

Write text to plot with halo underneath
toupper1

capitalize words
timeAxis

Label date axis
addAlpha

Color transparency