follower_dot_plot: Plot function for datasets created by...

View source: R/followerdotplot.R

follower_dot_plotR Documentation

Plot function for datasets created by rtweetXtras::get_followers_fast

Description

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.

Usage

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"
)

Arguments

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"

Examples

arfness_followers <- rtweetXtras::get_followers_fast("arfness", file_path = "~/")
follower_dot_plot (arfness_followers, point_colour = "followers_count", show_legend = TRUE, log_transform =TRUE)

Arf9999/rtweetXtras documentation built on June 27, 2022, 5:10 a.m.