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

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Berry Boessenkool

Last Published

March 25th, 2018

Functions in berryFunctions (1.17.0)

anhang

open the Appendix of Rclick
almost.equal

Vectorized testing for near-equality
addAlpha

Color transparency
around

View values around an index
TFtest

Test logical expressions
berryFunctions-package

Berry's functions
betaPlot

Beta density plot
addFade

Color fade out
addRows

Add n rows to a data.frame
approx2

Smart linear NA interpolation
betaPlotComp

Compare beta distributions
between

Are values between a and b?
classify

Classification into groups
circle

Draw circle with a given radius
checkFile

check file existence
climateGraph

climate graph after Walter and Lieth
colPoints

Points colored relative to third dimension
createFun

create function framework
ci

calculate confidence interval around mean
createPres

Create .Rnw presentation template
ciBand

polygon confidence bands
colPointsHist

Histogram for colPoints
getColumn

get column from data.frame
compareFiles

Compare textfiles for equality
getName

get the name of an input in nested function calls
expReg

Exponential regression with plotting
convertUmlaut

Convert German Umlaute to ASCII
funSource

Source code of a function
gof

GOF measures
divPal

Diverging color palette
headtail

head and tail
googleLink2pdf

extract pdf link from google search result
funTinn

Open function in TinnR
dupes

Duplicate lines in file
groupHist

Histogram for classes
legendmt

legend with multiline title
funnelPlot

Funnel plots for proportional data
l2df

List to data.frame
dataStr

str of datasets
library2

install.package and require
exTime

Time to run examples
horizHist

Horizontal histogram
distance

Distance between points
exp4p

4-parametric exponential function
instGit

install github package
insertRows

insert rows to data.frame
logHist

Histogram of logarithmic values
locArrow

arrow at locator point in graph
colPointsLegend

Legend for colPoints
is.error

Check if an expression returns an error
logSpaced

Logarithmically spaced points
combineFiles

Combine Textfiles into one
l2array

Convert list of arrays to array
nameSample

Nonrandom character sequence with sample
linLogTrans

Animation for transition from linear to logarithmic axis
locLine

abline at locator point in graph
lsc

Linear storage cascade, unit hydrograph
logAxis

Label logarithmic axes
linReg

linear regression with plotting
movAvLines

Moving average with different window widths
packagePath

Base path of package
lim0

axis limits with one end at zero
na9

Prepend spaces before na.strings
logVals

Create log-axis values and labels
parallelCode

code chunk for parallelization
normalizePathCP

normalizePath Cross Platform
linLogHist

lin-log transition histogram
newFilename

Create new filename if file already exists
normPlot

Normal density plot
lsMem

Show memory size of objects in MB
openFile

open file in default application
mReg

Multiple regression
owa

Overwrite argument default lists
rescale

shift and scale a vector
monthAxis

Label date axis
rainbow2

Rainbow from blue to red
round0

Round numbers with leading and trailing zeros
monthLabs

Nicely spaced labels along a month
roundedRect

Rectangles with rounded corners
movAv

Moving average
runAxis

Label axis with typical running times
removeSpace

Remove white spaces from strings
smoothLines

draw smoothed lines
popleaf

create leaflet popup box info
seasonality

Seasonality analysis
spiralDate

Spiral graph of time series
pretty2

Truncated pretty breakpoints
timer

Timer alarm
spiralDateAnim

Animated spiral graph
seqPal

Sequential color palette
tryStack

try an expression, returning the error stack
panelDim

Arrange panels in a multipanel plot (par mfrow)
superPos

superposition of discharge, unit hydrograph
traceCall

call stack of a function
quantileBands

Quantile bands
pdfpng

Create pdf and png graph
unitHydrograph

Unit Hydrograph
yearSample

Nonrandom year with sample
quantileMean

Average of R's quantile methods
sortDF

sort dataframes by column
textField

Write text to plot with halo underneath
seqR

seq with a range argument
smallPlot

Inset small plot within figure
showPal

show color palettes
tableColVal

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

capitalize words
timeAxis

Label date axis
truncMessage

truncate message parts