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
.
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) names(alldata) allloc<- sqldf("select distinct location_name from alldata") allloc<- na.omit(allloc) nrow(allloc)
The output is as follows:
[1] 432
There are posts from 432 different location in the dataset collected by us. Let's get a snapshot...