View profile

Facebook Ad Library | Next - Issue #32

Harshvardhan
Harshvardhan
Hi there!
I spent almost all of my last week playing Catan. Initially, I was terrible at it. It is a board game with very few rules but requires deep thoughts and strategies. Richard Dansky says,
“It’s a resource-management game, defined by position and strategizing. It’s a game of chance, ruled by dice rolls and card draws. It’s a hardcore game, a light social pastime, and everything in between, a laboratory where I can test a hundred different play styles and a genuine reason to invite friends over.”
Today’s letter talks about APIs, creating posters with Shiny and more. Do check out the Jargons section for a discussion on p-values. Let’s dive in!

Five Stories
Sometimes you may want to highlight others or your paper during a presentation. You might like to draw the audience’s attention to them by writing something more than Smith et al. (2022) or just [2]. (Using [2] is annoying, in my opinion. Names are more memorable than numbers.)
namedropR gives you the functionality to add beautiful citations into your R Markdown, Xaringan or Quatro document. The citations can be rendered as HTML or as images. It also adds a cute QR code so the enthusiastic ones can scan and read along! Check the Twitter thread or Github to know more.
Real-world research requires real-world datasets. Today, with the ease of APIs, our job has been simplified on many levels. This collaborative book brings together API guidelines for several internet software, including Facebook Ads, Instagram, Github, Google (News, Translation, Trends, YouTube), Twitter and more.
Each API’s use is demonstrated first using httr::GET() and R packages when available. Check it out for your next cool project!
While we are on the topic of APIs, I couldn’t resist sharing FB’s Ad Library API package in R called Radlibrary. The package allows you to get attributes about ads posted on Facebook.
Before you jump to using the package, take a look at the Ad Library webpage. Meta allows you to explore all ads on its platform, and filter by type of ad (political, commercial, etc.). You can also search for ads by category and country. You can also download the ad data (without the API) from their website.
Recently, more conferences are accepting digital poster presentations. It gives us an opportunity to add interactivity to our posters. Jason built a template for an interactive poster where you display information such that the audience can interact with it.
See an example by running shiny::runGitHub('jbryer/ShinyPoster') in RStudio. The template isn’t difficult to edit and Jason provides sufficient commentatory to follow along.
Summer is coming and so are beautiful sunsets! Hilary created an R function to add sunsets every day to her calendar. All thanks to sunrise.set() from StreamMetabolism.
The function is available in her personal R package out of the box. Simple function. Simple application. Incredible product!
Four Packages
keyring provides platform-independent credentials storage and retrieval. You can access macOS Keychain, Windows Credential Store and Linux Secret Service. One more reason not to store API keys and passwords in plain text. Github.
ggblanket is a ggplot2 wrapper with functions to process geom_ objects. Some critical differences with ggplot2: col and fill are both col, faceting is an aesthetic, etc. Github.
collapse is C/C++ based package for data transformation and statistical computing. It is class-agnostic; it works with base R’s data frame, tibbles, data.table, sf, zoo and many other data objects in R. Github.
vscode-R is an extension for using R in Visual Studio. It provides numerous benefits over base R; I don’t know how it compares with RStudio. (If you have used it earlier, tell me about it.) Github.
Three Jargons
Node Impurity measures how homogenous a node is in tree-based models. Read more about it here.
Interpreting p-values can be tricky. There are two approaches: the Fisher’s way and Neyman-Pearson’s way.
Neyman-Pearson [NP] said that you pick a cutoff and you use it. It’s less than the cutoff(say, 0.05) or it’s not. There’s no other information to convey. In NP, 0.08 and 0.97 are the same.
Fisher said you take the p-value and you treat it as the level of evidence that there is an effect. <0.2 is some evidence, but it’s pretty weak; <0.1 is a bit better, but still kind of weak. <0.05 is what Fisher said is often good enough (but he also wrote that one should change one’s significance level according to the situation, which no one does).
Two Tweets
Last week, Joseph Rickert was strolling down the crowded market square of Twitter looking for R related tweets. This short blog is a collection of items he found interesting. Check it out!
One Meme
Bonus
If you read Wikipedia a lot, try this Chrome plugin. It turns Wikipedia into a beautiful encyclopedia. Also, when you’re struggling with debugging your code, look at this picture and figure out your next strategy.
That's a wrap!
I hope you learned something new today. As always, your feedback and suggestions are always welcome. See you next week!
Harsh
Did you enjoy this issue? Yes No
Harshvardhan
Harshvardhan @harshbutjust

A short and sweet curated collection of R-related works. Five stories. Four packages. Three jargons. Two tweets. One Meme.

List of all packages covered in past issues: https://www.harsh17.in/nextpackages/.

In order to unsubscribe, click here.
If you were forwarded this newsletter and you like it, you can subscribe here.
Created with Revue by Twitter.
Knoxville, Tennessee.