View profile

Street maps, free APIs and Topic Modelling | Next - Issue #33

Harshvardhan
Harshvardhan
Hi there,
At 8:15 p.m. on Saturday, July 26, 1952, a pilot and stewardess on a National Airlines flight into Washington observed some lights above their plane. Within minutes, both radar centres at National Airport, and the radar at Andrews Air Force Base, were tracking more unknown objects. Very soon, around seven of them appeared around the White House.
Then-president Harry Truman asked the air force to “track and take them down”. Around 11:30 p.m., two F-94 jets started chasing them. One of them could see nothing live, even though there were non-stop radar bleeps. The other could see four of them around him. He asked the control tower what to do, but no one knew what to do, and the blips disappeared as quickly as they appeared.
Later, the weather station said it was due to temperature inversion, which causes weird visual phenomenons. Almost everyone involved refused to accept that explanation. Eerie, right?
Let’s dive in.

Five Stories
Street maps of cities are beautiful — even though we never actually use them these days. They are an excellent gift to your friend moving to a new city. This tutorial teaches you how to build such maps using ggplot2. You can include highways, streets and even rivers. The tutorial is so simple that I spent my weekend exploring maps of different cities worldwide.
The mapping is based on data from the OpenStreetMaps package in R. Check out the tutorial and build the next decorative piece for your living room!
Two weeks ago, I wrote about pins package in R. To recall, pins provide an easy way to share things across people or projects. They allow for versioning data, so you don’t have to keep exchanging Excel spreadsheets back and forth via email. With the help of vertiver package, it also allows sharing multiple versions of models, thus keeping everyone on the same page.
What’s the benefit of using pins over a Github repository? Usually nothing. But are you using a shared Github repository for every project? If not, this would be your best bet. Learn more in this tutorial by Katie Masiello and Jesse Mostipak.
Last week, I wrote about using APIs in R. Specifically, I talked about Radlibrary and APIs for Social Scientists. Today, I am listing a (very long) list of free APIs that we can use for software development. Some notable APIs:
  • MeowFacts: Get random facts about cats. Did you know of all the species of cats, the domestic cat is the only species able to hold its tail vertically while walking? All species of wild cats hold their tail horizontally or tucked between their legs while walking.
  • GoFile: Unlimited size file uploads for free
  • Oxford: Dictionary and thesaurus
  • mail.tm: Temporary email service
  • WolframAlpha: Provides specific answers to questions using data and algorithms
  • SkyBiometry: Face Detection, Face Recognition and Face Grouping
And many more. Now the question is, what are you building next with it?
Do you feel your Shiny apps are too similar to everyone else’s apps? designer is here to help.
The package contains a shiny application that enables the user to build the UI of a shiny application by dragging and dropping several shiny components - such as inputs, outputs and buttons - into one of the available pages in the shiny package.
Note that the app only helps with UI. You still have to work on the server yourself. You can also add comments to any part for your own notes.
Twitter’s API is a goldmine for academic research. One important field of study with textual data is Topic Modelling, where the researcher analyses logs of texts to distil content to a selected few words — referred to as “topics”.
Andreas’ package automates much of the task to a few functions. You provide your search topics for Tweets. It gives four metrics to choose the number of topics. Finally, you can fit the topic model using two methods: Latent Dirichlet Allocation (LDA) and Structural Topic Modelling (STM).
I’m in love with its interactive tweet map function.
Four Packages
overviewR makes it easy to get summary details about long data, typically required for panel data analysis. See the vignette here.
flyCSV gives the function flyCSV() using which you can open any data frame in Excel from R itself! This is useful for cases when View() is not enough. See their Github for more information.
ggtips adds interactive tooltips to ggplot2 plots. They can be used in Shiny apps as well as standalone. See their Github for more information.
pins package publishes data, models, and other R objects, making it easy to share them across projects and with your colleagues. Read the vignette here.
Three Jargons
Panel data is information recorded about multiple individuals across time.
Cross-sectional data is information recorded about multiple individuals at a point in time.
Time-series data is information recorded about an individual across time.
Two Tweets
Harshvardhan
Making maps in #rstats is so fun! A thread cool street maps🧵

Here is how my current home @visitknoxville looks https://t.co/wLv24OQWsd
Lisa DeBruine 🏳️‍🌈
TIL: If you're annoyed by your #rstats github repos being marked as HTML because of the documentation that all your R code produces, add a .gitattributes file with the following:

*.html linguist-detectable=false https://t.co/4LpMaXUrdB
One Meme
Source: xkcd. https://www.explainxkcd.com/wiki/index.php/552:_Correlation
Source: xkcd. https://www.explainxkcd.com/wiki/index.php/552:_Correlation
Bonus
Setting boundaries and saying no is not easy for many of us. How to say no is a collection of email templates that you can use to decline social events, meetings, dates, phone chats and other work-related requests you might get. My favourite one is from Naval Ravikant (although I don’t think I’m ever gonna use it):
Hey {{ first_name }},
Just want to be upfront.
I don’t do non-transactional meetings. I don’t do meetings without a strict agenda. I don’t do meetings unless we absolutely have to.
Naval
Naval’s two-hour talk with Joe Rogan probably has the highest wisdom per minute of any video on YouTube.
That's a wrap!
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.