data visualization

Gauges

Gauges are useful when wanting to display a quantity along with its range (minimum and maximum). Here, we will try out the plotly package’s functionality to build a gauge plot. library("plotly") library("tidyverse") # https://plotly.com/r/gauge-charts/ # https://marketing.ucmerced.edu/resources/brand-guidelines/colors my_gauge <- plot_ly( domain = list(x = c(0, 1), y = c(0, 1)), value = 6.35, title = list(text = "Overall Teaching Evaluation Score", color = "#002856", font = list(size = 24)), type = "indicator", mode = "gauge+number", gauge = list( axis = list(range = list(NULL, 7.

Continue reading

TidyTuesday 20220607

“The data this week comes from Data For Progress. “Each year, hundreds of corporations around the country participate in Pride, an annual celebration of the LGBTQ+ community’s history and progress. They present themselves as LGBTQ+ allies, but new research from Data for Progress finds that in between their yearly parade appearances, dozens of these corporations are giving to state politicians behind some of the most bigoted and harmful policies in over a decade.

Continue reading

Counting Political Mail

sender <- c("Steve Glaser", "Anna Caballero", "Esmeralda Soria", "Mike Karbassi", "Adam Gray", "CA Real Estate", "CFT", "misc") counts <- c(3, 3, 10, 6, 4, 4, 3, 1) df <- data.frame(sender, counts) df <- df |> mutate(for_label = paste0(sender, ": ", counts)) |> mutate(sender_ranked = forcats::fct_reorder(sender, counts)) df |> ggplot() + geom_bar(aes(x = counts, y = sender_ranked, fill = sender_ranked), stat = "identity") + geom_text(aes(x = counts, y = sender_ranked, label = for_label), hjust = "right", nudge_x = -0.

Continue reading