The faces of R, analyzed with R

April 7, 2017
By

(This article was first published on Revolutions, and kindly contributed to R-bloggers)

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 on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Sponsors

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)