R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

Including Plots

You can also embed plots, for example:

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.

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.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.4     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── 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
five38_mlb <- read_csv("https://projects.fivethirtyeight.com/mlb-api/mlb_elo.csv")
## Rows: 228326 Columns: 26
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr   (5): playoff, team1, team2, pitcher1, pitcher2
## dbl  (20): season, neutral, elo1_pre, elo2_pre, elo_prob1, elo_prob2, elo1_p...
## date  (1): date
## 
## ℹ 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.
mushrooms <- read_csv("/Users/jjt_m1air/Downloads/mushroom/agaricus-lepiota.data")
## New names:
## Rows: 8123 Columns: 23
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (22): p...1, x, s...3, n...4, p...6, f, c, n...9, k...10, e...11, e...12... lgl
## (1): t
## ℹ 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.
## • `p` -> `p...1`
## • `s` -> `s...3`
## • `n` -> `n...4`
## • `p` -> `p...6`
## • `n` -> `n...9`
## • `k` -> `k...10`
## • `e` -> `e...11`
## • `e` -> `e...12`
## • `s` -> `s...13`
## • `s` -> `s...14`
## • `w` -> `w...15`
## • `w` -> `w...16`
## • `p` -> `p...17`
## • `w` -> `w...18`
## • `p` -> `p...20`
## • `k` -> `k...21`
## • `s` -> `s...22`