#Bold and Italics Wayne Hansel Muigai
Newton Rayzor Elementary School
“Today is Sunday”
To study Jordan block diagonalization Jordan block
#Bunnies Cartoon Cartoon
#Sta Statistics
https://media1.tenor.com/m/pnK2MIoEAccAAAAC/hadley-wickham.gif
########2 Chunks
# Load libraries
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.0 ✔ stringr 1.5.1
## ✔ ggplot2 3.5.2 ✔ tibble 3.2.1
## ✔ lubridate 1.9.4 ✔ tidyr 1.3.1
## ✔ purrr 1.0.4
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(readr)
# Read the data
right_to_work <- read_csv("right_to_work_2000_onward.csv")
## Rows: 765 Columns: 4
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (2): st, state
## dbl (2): year, value
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# Summarize and plot
right_to_work %>%
group_by(state) %>%
summarise(mean_value = mean(value, na.rm = TRUE)) %>%
ggplot(aes(x = reorder(state, mean_value), y = mean_value)) +
geom_col(fill = "steelblue") +
coord_flip() +
labs(title = "Average Value by State",
x = "State",
y = "Average Value") +
theme_minimal()
#### Export and share