Luke Davis's personal package of useful R functions.
stat_mode
: computes the mode (most frequently occurring value) of vectorsrun_time
: simple, easy to use function that tells you how long a command took to run. Intended for interactive or script use, not benchmarking (use microbenchmark
for that).parallelize
: manages code for setting up and spinning down CPU clusters, cleaning up your code and preventing mistakesrolling
: computes functions over rolling windows. Can be used to create rolling means or medians with variable look back or look forward windows, or more creatively for general purpose computation over windows.holiday_dates
: vectorized holiday date lookup. Deals with the weirdness of the timeDate
package's interface, making it easy to pull all holiday dates for a given country and year en masse.You can use the devtools
package to install luketools
. First, install devtools
(if you don't already have it) by running install.packages("devtools")
. Next, use devtools
to install the package from github by running devtools::install_github("lukerobert/luketools")
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.