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

1,957

Version

1.22.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Berry Boessenkool

Last Published

April 12th, 2023

Functions in berryFunctions (1.22.0)

TFtest

Test logical expressions
addFade

Color fade out
berryFunctions-package

Berry's functions
anhang

open the Appendix of Rclick
around

View values around an index
addAlpha

Color transparency
betaPlot

Beta density plot
bmap

title
climateGraph

climate graph after Walter and Lieth
addRows

Add n rows to a data.frame
checkFile

check file existence
circle

Draw circle with a given radius
colPointsHist

Histogram for colPoints
colPointsLegend

Legend for colPoints
betaPlotComp

Compare beta distributions
catPal

Categorical color palette
compareFiles

Compare textfiles for equality
between

Are values between a and b?
ciBand

polygon confidence bands
getColumn

get column from data.frame
combineFiles

Combine Textfiles into one
compareDist

compare distributions
exp4p

4-parametric exponential function
getName

get the name of an input in nested function calls
classify

Classification into groups
expReg

Exponential regression with plotting
dataStr

str of datasets
gof

GOF measures
distance

Distance between points
horizHist

Horizontal histogram
locLine

abline at locator point in graph
if.error

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

linear regression with plotting
locArrow

arrow at locator point in graph
convertUmlaut

Convert German Umlaute to ASCII
googleLink2pdf

extract pdf link from google search result
locatorRS

locator with immediate points in Rstudio
learnVocab

spaced learning
groupHist

Histogram for classes
colPoints

Points colored relative to third dimension
legendmt

legend with multiline title
createFun

create function framework
headtail

head and tail
movAvLines

Moving average with different window widths
logSpaced

Logarithmically spaced points
createPres

Create .Rnw presentation template
funSource

Source code of a function
nameSample

Nonrandom character sequence with sample
newFilename

Create new filename if file already exists
logVals

Create log-axis values and labels
na9

Prepend spaces before na.strings
divPal

Diverging color palette
funnelPlot

Funnel plots for proportional data
normalizePathCP

normalizePath Cross Platform
dupes

Duplicate lines in file
openFile

open file in default application
pretty2

Truncated pretty breakpoints
quantileBands

Quantile bands
insertRows

insert rows to data.frame
linLogHist

lin-log transition histogram
par_sapply

cross-platform parallel processing with progbar
showPal

show color palettes
smallPlot

Inset small plot within figure
l2array

Convert list of arrays to array
textField

Write text to plot with halo underneath
pdfpng

Create pdf and png graph
popleaf

create leaflet popup box info
linLogTrans

Animation for transition from linear to logarithmic axis
timeAxis

Label date axis
tableColVal

Table with values with value-dependent colored backgrounds in pdf
is.error

Check if an expression returns an error
testExamples

Test examples in a package
timer

Timer alarm
tmessage

messages with call trace
library2

install.package and library
lim0

axis limits with one end at zero
parallelCode

code chunk for parallelization
traceCall

call stack of a function
mReg

Multiple regression
runAxis

Label axis with typical running times
runRversions

Run code in several R versions
lsMem

Show memory size of objects in MB
l2df

List to data.frame
monthAxis

Label date axis
lsc

Linear storage cascade, unit hydrograph
truncMessage

truncate message parts
openPDF

open PDF file with sumatra viewer
normPlot

Normal density plot
yearSample

Nonrandom year with sample
normTest

Test values for normality of distribution
quantileMean

Average of R's quantile methods
logAxis

Label logarithmic axes
logHist

Histogram of logarithmic values
owa

Overwrite argument default lists
rainbow2

Rainbow from blue to red
seqPal

Sequential color palette
monthLabs

Nicely spaced labels along a month
movAv

Moving average
seqR

seq with a range argument
sumatraInitialize

Set useful Sumatra PDF Viewer default settings
removeSpace

Remove white spaces from strings
superPos

superposition of discharge, unit hydrograph
rescale

shift and scale a vector
runTime

runnning time conversion
packagePath

Base path of package
seasonality

Seasonality analysis
tryStack

try an expression, returning the error stack
spiralDate

Spiral graph of time series
panelDim

Arrange panels in a multipanel plot (par mfrow)
round0

Round numbers with leading and trailing zeros
roundedRect

Rectangles with rounded corners
unitHydrograph

Unit Hydrograph
smoothLines

draw smoothed lines
spiralDateAnim

Animated spiral graph
write.tab

write table with different defaults
yearPlot

annual plot
sortDF

sort dataframes by column
approx2

Smart linear NA interpolation
almost.equal

Vectorized testing for near-equality