O'Reilly logo

Mastering Social Media Mining with R by Vikram Garg, Sharan Kumar Ravindran

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Finding the most popular destination

We explored some of the user metrics as well as the media metrics. Now, we will explore the geography of the media posts. We can get the geo-location if it has been enabled by the user. We will perform this analysis on the dataset alldata.

Locations

In the following code, we are just getting the unique locations found in the dataset collected by us. Since we are getting the data with the help of a query, we need to load the sqldf package in the R console and use the function na.omit to remove the posts without any location details. The following code consolidates the locations and finally, using the function nrow, we get to know about the unique number of locations from where the posts were made.

library(sqldf) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required