This Code is Big Time

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

EE https://www.ericekholm.com/
2021-04-25

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():

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.

Citation

For attribution, please cite this work as

EE (2021, April 25). Eric Ekholm: This Code is Big Time. Retrieved from https://www.ericekholm.com/posts/2021-04-25-this-code-is-big-time/

BibTeX citation

@misc{ee2021this,
  author = {EE, },
  title = {Eric Ekholm: This Code is Big Time},
  url = {https://www.ericekholm.com/posts/2021-04-25-this-code-is-big-time/},
  year = {2021}
}