This Code is Big Time

Wrap your R code in Your Mom’s House audio drops

R
tutorial
Your Mom’s House
programming
Published

April 25, 2021

What’s up, Jeans. This short post is targeting the very niche crowd of R users who also happen to love Tim and Christine, the main mommies of Your Mom’s House. Basically, I discovered the {beepr} package a few days ago, which makes it easier you play short sound files through R, and so naturally my first thought was to “try it out” with a YMH drop. The result was 2 functions added to my personal/miscellaneous package, {eemisc}:

I’ll demonstrate these below.

Setup

To use these functions, you’ll need my personal package, {eemisc}, installed. You can install it via Github via the following command:

remotes::install_github("ekholme/eemisc")

Eventually, I might put these functions into their own package, but for now they live in my odds-and-ends package.

Big Time

To play the “THIS SHIT IS BIG TIME” drop, you just need to call the function big_time():

library(eemisc)

big_time()

That’s it. That will play the drop.

Big Time Operator

But I took it a step further for all of my kings and queens above 18. The big_time_operator() takes a function of your choosing and produces as its output a new function that wraps the input function with the “big time” drop. Want to let everyone know that taking the mean is big time?

big_time_mean <- big_time_operator(mean)

x <- 1:10

big_time_mean(x)
[1] 5.5

You can pass any function you want into big_time_operator() to get the same effect.

Anyway, that’s all for now. Keep it high and tight, Jeans, and you bet I’m coming up in May.

Reuse

Citation

BibTeX citation:
@online{ekholm2021,
  author = {Ekholm, Eric},
  title = {This {Code} Is {Big} {Time}},
  date = {2021-04-25},
  url = {https://www.ericekholm.com/posts/this-code-is-bigtime},
  langid = {en}
}
For attribution, please cite this work as:
Ekholm, Eric. 2021. “This Code Is Big Time.” April 25, 2021. https://www.ericekholm.com/posts/this-code-is-bigtime.