From the dataset we built, we will work on identifying the most popular users using different aspects. Let's see those in detail.
We can get the users with most number of followers from the dataset userprofiles
by sorting the data using the column followed_by
and using the function order
. The following code will return the dataset by sorting the data in the descending order based on the column followed_by
. The code is as follows:
mostfollowed<- userprofiles[with(userprofiles, order(-followed_by)), ] head(mostfollowed$full_name, 15)
The output is as follows:
To know the user who follows the most number of people, we use the same dataset userprofiles
. Everything is similar to the previous one, but we need to use the column follows
instead of followed_by
. The code is as follows:
mostfollows<- userprofiles[with(userprofiles, order(-follows)), ] head(mostfollows$full_name, 15)
The output is as follows:
The preceding output...