The faces of R, analyzed with R

[This article was first published on Revolutions, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Maëlle Salmon recently created a collage of profile pictures of people who use the #rstats hashtag in their Twitter bio to indicate their use of R. (I've included a detail below; click to see the complete version at Maëlle's blog.)

FacesofR-detail

Naturally, Maëlle created the collage using R itself. Matching Twitter bios were found using the search_users function in the rtweet package, which also provides the URL of the profile image to be downloaded using the httr package. From there, Maëlle used the magick package to resize the pictures and assemble the collage.

Now, you'll notice that while many people use their face as their Twitter profile picture, others use a logo or some other kind of design. Colin Fay used the Microsoft Computer Vision API to analyze the profile pictures and generate a descriptive caption for each. (Once again, the process was automated using R; you can find the R code at Colin's blog post.) Some of the generated captions are straightforward: “a woman posing for a picture”. Some of the captions are, well, a bit off the mark: “a person on a surf board in a skate park”. (The API apparently thinks the R logo looks like a surfboard; captions like this at least had a lower confidence score.) Nonetheless, the captions provide a tool for collecting together similar images; here, for example, are those given the caption “a person on a surf board in a skate park:

Surfboards

If you'd like to play around with the computer vision captions yourself, you'll just need a free API key and the code from Colin's blog post, linked below.

Colin FAY: Playing with #RStats and Microsoft Computer Vision API

To leave a comment for the author, please follow the link and comment on their blog: Revolutions.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)