library(evently) library(ggplot2) library(tsne) knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
This vignette gives a tutorial on profiling Twitter users with their initiated diffusions via modeling methods provided by evently
.
We use the dataset auspol
shipped with evently
in this task. It is a list of data frames (r length(auspol)
in total) where each data frame represents a diffusion cascade. For each cascade, three fields are presented: time
is the retweeting time relative to the original tweet (i.e., the first event); user
is the corresponding Twitter user of the event; magnitude
is the number of followers the Twitter user has.
head(auspol, n = 3)
names(auspol) <- sapply(auspol, function(data) data$user[[1]]) auspol_group_fits_by_user <- group_fit_series(data = auspol, model_type = 'mPL', observation_times = Inf, cores = 10) head(auspol_group_fits_by_user, n = 3)
# keep only users with more than 5 cascades auspol_group_fits_by_user <- Filter(function(x) length(x) >= 5, auspol_group_fits_by_user) dist_matrix <- fits_dist_matrix(auspol_group_fits_by_user) positions <- tsne(dist_matrix, k = 2)
ggplot(as.data.frame(positions), aes(V1, V2)) + geom_point() + theme_void()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.