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

2,405

Version

1.21.14

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Berry Boessenkool

Last Published

May 13th, 2022

Functions in berryFunctions (1.21.14)

addRows

Add n rows to a data.frame
almost.equal

Vectorized testing for near-equality
around

View values around an index
anhang

open the Appendix of Rclick
TFtest

Test logical expressions
berryFunctions-package

Berry's functions
addFade

Color fade out
addAlpha

Color transparency
betaPlot

Beta density plot
approx2

Smart linear NA interpolation
classify

Classification into groups
createPres

Create .Rnw presentation template
climateGraph

climate graph after Walter and Lieth
createFun

create function framework
getColumn

get column from data.frame
compareDist

compare distributions
between

Are values between a and b?
convertUmlaut

Convert German Umlaute to ASCII
betaPlotComp

Compare beta distributions
dataStr

str of datasets
funnelPlot

Funnel plots for proportional data
colPoints

Points colored relative to third dimension
locArrow

arrow at locator point in graph
catPal

Categorical color palette
distance

Distance between points
colPointsHist

Histogram for colPoints
divPal

Diverging color palette
ciBand

polygon confidence bands
funSource

Source code of a function
locatorRS

locator with immediate points in Rstudio
horizHist

Horizontal histogram
headtail

head and tail
checkFile

check file existence
expReg

Exponential regression with plotting
compareFiles

Compare textfiles for equality
logAxis

Label logarithmic axes
googleLink2pdf

extract pdf link from google search result
rescale

shift and scale a vector
groupHist

Histogram for classes
l2df

List to data.frame
packagePath

Base path of package
movAv

Moving average
owa

Overwrite argument default lists
locLine

abline at locator point in graph
round0

Round numbers with leading and trailing zeros
movAvLines

Moving average with different window widths
removeSpace

Remove white spaces from strings
legendmt

legend with multiline title
learnVocab

spaced learning
rainbow2

Rainbow from blue to red
dupes

Duplicate lines in file
exp4p

4-parametric exponential function
colPointsLegend

Legend for colPoints
combineFiles

Combine Textfiles into one
is.error

Check if an expression returns an error
circle

Draw circle with a given radius
library2

install.package and library
gof

GOF measures
logSpaced

Logarithmically spaced points
if.error

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

Histogram of logarithmic values
getName

get the name of an input in nested function calls
na9

Prepend spaces before na.strings
insertRows

insert rows to data.frame
seqPal

Sequential color palette
nameSample

Nonrandom character sequence with sample
seasonality

Seasonality analysis
quantileMean

Average of R's quantile methods
lim0

axis limits with one end at zero
normPlot

Normal density plot
newFilename

Create new filename if file already exists
spiralDateAnim

Animated spiral graph
linLogHist

lin-log transition histogram
quantileBands

Quantile bands
tmessage

messages with call trace
sumatraInitialize

Set useful Sumatra PDF Viewer default settings
monthAxis

Label date axis
logVals

Create log-axis values and labels
par_sapply

cross-platform parallel processing with progbar
roundedRect

Rectangles with rounded corners
monthLabs

Nicely spaced labels along a month
lsMem

Show memory size of objects in MB
panelDim

Arrange panels in a multipanel plot (par mfrow)
openFile

open file in default application
l2array

Convert list of arrays to array
traceCall

call stack of a function
superPos

superposition of discharge, unit hydrograph
linLogTrans

Animation for transition from linear to logarithmic axis
seqR

seq with a range argument
openPDF

open PDF file with sumatra viewer
linReg

linear regression with plotting
lsc

Linear storage cascade, unit hydrograph
parallelCode

code chunk for parallelization
normTest

Test values for normality of distribution
normalizePathCP

normalizePath Cross Platform
mReg

Multiple regression
runRversions

Run code in several R versions
pretty2

Truncated pretty breakpoints
pdfpng

Create pdf and png graph
popleaf

create leaflet popup box info
runTime

runnning time conversion
smallPlot

Inset small plot within figure
truncMessage

truncate message parts
tableColVal

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

try an expression, returning the error stack
timeAxis

Label date axis
runAxis

Label axis with typical running times
timer

Timer alarm
smoothLines

draw smoothed lines
write.tab

write table with different defaults
spiralDate

Spiral graph of time series
unitHydrograph

Unit Hydrograph
yearPlot

annual plot
sortDF

sort dataframes by column
testExamples

Test examples in a package
yearSample

Nonrandom year with sample
textField

Write text to plot with halo underneath
showPal

show color palettes