View source: R/followerdotplot.R
follower_dot_plot | R Documentation |
This builds a ggplot2 scatter plot with the creation date of twitter followers mapped to the order in which they followed. Various options of dot colouring are available to examine the follower's attributes. Optionally, a loess smoothed curve and/or a linear model can be overlaid to analyse the change in follower creation dates over time.
follower_dot_plot( follower_df, point_colour = "statuses_count", show_legend = TRUE, suppress_warnings = TRUE, include_loess_smooth = FALSE, include_lm = FALSE, print_immediately = TRUE, log_transform = FALSE, viridis_option = "magma" )
follower_df |
Required. A dataframe or tibble created with rtweetXtras::get_followers_fast. |
point_colour |
maps the dot colour to one of: "statuses_count", "lang", "source", "favourites_count", "followers_count", or "earliest_follow". Default is "statuses_count". |
show_legend |
Display chart legend. Default is TRUE, but where there are many categorical items (e.g. "lang or "source"), recommended to set to FALSE. |
suppress_warnings |
Suppress ggplot warnings from printed plots. Default is TRUE. Recommended to use default for .rmd knitting. |
include_loess_smooth |
Include loess smoothed curve with se shading. Default is FALSE |
include_lm |
Include a linear model line with se shading. Default is FALSE |
print_immediately |
Force the function to print the plot immediately. Default is TRUE, set to FALSE to assign the ggplot object. |
log_transform |
Transform the legend scale to a log scale. Default is FALSE. Useful if there is a concentration of small values that makes it difficult to see any graduation. Ignored for categorical and date scales. |
viridis_option |
Sets the viridis colour palette. Default is "magma" Options are "viridis", "plasma", "magma", "inferno" and "cividis" |
arfness_followers <- rtweetXtras::get_followers_fast("arfness", file_path = "~/") follower_dot_plot (arfness_followers, point_colour = "followers_count", show_legend = TRUE, log_transform =TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.