data visualization

Stardew Valley Expanded

Now that I finally have some free time, I want to play the Stardew Valley Expanded mod. But first, let us make a flow chart of the mods and their dependencies. library("DiagrammeR") my_plot <- DiagrammeR::mermaid(" graph LR SMAPI[SMAPI] Content_Patcher[Content Patcher] Custom_NPC_Exclusions[Custom NPC Exclusions] Expanded_Preconditions_Utility[Expanded Preconditions Utility] Extra_Map_Layers[Extra Map Layers] Farm_Type_Manager[Farm Type Manager] JSON_Assets[JSON Assets] SAAT[SAAT] Shop_Tile_Framework[Shop Tile Framework] Spacecore[Spacecore] Stardew_Valley_Expanded{Stardew Valley Expanded} SMAPI --> Content_Patcher SMAPI --> Custom_NPC_Exclusions SMAPI --> Expanded_Preconditions_Utility SMAPI --> Extra_Map_Layers SMAPI --> Farm_Type_Manager SMAPI --> JSON_Assets SMAPI --> Shop_Tile_Framework SMAPI --> Spacecore Content_Patcher --> Farm_Type_Manager Expanded_Preconditions_Utility --> JSON_Assets Expanded_Preconditions_Utility --> Shop_Tile_Framework Spacecore --> JSON_Assets SMAPI --> Stardew_Valley_Expanded Content_Patcher --> Stardew_Valley_Expanded Custom_NPC_Exclusions --> Stardew_Valley_Expanded Expanded_Preconditions_Utility --> Stardew_Valley_Expanded Extra_Map_Layers --> Stardew_Valley_Expanded Farm_Type_Manager --> Stardew_Valley_Expanded JSON_Assets --> Stardew_Valley_Expanded SAAT --> Stardew_Valley_Expanded Shop_Tile_Framework --> Stardew_Valley_Expanded Spacecore --> Stardew_Valley_Expanded ")

Continue reading

Ridge Plots

library("ggridges") library("patchwork") library("tidyverse") # load data df <- readr::read_csv("BioSQuaRE_data.csv") # wrangling df$term <- factor(df$term, levels = c("Summer 2020","Fall 2020", "Spring 2021", "Fall 2021")) df_pre <- df |> filter(iter == "pre-test") df_post <- df |> filter(iter == "post-test") plot_pre <- df_pre |> ggplot(aes(x = Item, y = term, height = UCMer, group = term)) + geom_ridgeline(color = "#DAA900", fill = "#002856") + labs(title = "BioSQuaRE Results", subtitle = "pre-test", caption = "", x = "Test Question", y = "") + theme( axis.

Continue reading

Pascal's Triangle

Once again, I find that I have been nerd sniped (inspired by Mathigon). Today, I want to plot (and make an animation) for Pascal’s Triangle mod n. What I am thinking is store Pascal Triangle numbers along with row and column numbers in a data frame then assign x and y values rescale the x and y values to make an equilateral triangle # load package(s) library("tidyverse") # allocate data space N <- 50 #number of rows of wanted Pascal's Triangle # EDIT: my computer or software did not seem to handle larger numbers well row_total <- N*(N+1) / 2 #sum of 1 + 2 + .

Continue reading

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