Treat programs as a “literature” understandable to human beings
quarto_demo.qmd
Add table of contents, change theme
More on themes at https://quarto.org/docs/output-formats/html-themes.html
normal text_italic text_*italic text***bold text*****bold italic text***~~strikethrough~~`code text`code textSimple url link to another site:
Produces this:
The sum of 3 and 4 is 7
…will produce this when rendered:
#> Rows: 4
#> Columns: 8
#> $ species <fct> Adelie, Adelie, Adelie, Adelie
#> $ island <fct> Torgersen, Torgersen, Torgersen, Torgersen
#> $ bill_length_mm <dbl> 39.1, 39.5, 40.3, NA
#> $ bill_depth_mm <dbl> 18.7, 17.4, 18.0, NA
#> $ flipper_length_mm <int> 181, 186, 195, NA
#> $ body_mass_g <int> 3750, 3800, 3250, NA
#> $ sex <fct> male, female, female, NA
#> $ year <int> 2007, 2007, 2007, 2007
Control what chunks output using options
All options here
By default, code chunks print code + output
setup chunk 🌍15:00
Open the bears.qmd file, and title it “Bears Analysis”
Create a “setup” code chunk to read in the bear_killings.csv data file
(HINT: You might want to look back at the quarto_demo.qmd file!).
Use text and code to find answers each of the following questions - show your code and results to justify each answer:
HINT: Use bears %>% count(variable) to count how many rows are in the data for each unique value of variable

Concept developed by Leland Wilkinson (1999)
ggplot2 package developed by Hadley Wickham (2005)
#> # A tibble: 6 × 11
#> manufacturer model displ year cyl trans drv cty hwy fl class
#> <chr> <chr> <dbl> <int> <int> <chr> <chr> <int> <int> <chr> <chr>
#> 1 audi a4 1.8 1999 4 auto(l5) f 18 29 p compact
#> 2 audi a4 1.8 1999 4 manual(m5) f 21 29 p compact
#> 3 audi a4 2 2008 4 manual(m6) f 20 31 p compact
#> 4 audi a4 2 2008 4 auto(av) f 21 30 p compact
#> 5 audi a4 2.8 1999 6 auto(l5) f 16 26 p compact
#> 6 audi a4 2.8 1999 6 manual(m5) f 18 26 p compact
The ggplot() function initializes the plot with whatever data you’re using
The aes() function determines which variables will be mapped to the geometries
(e.g. the axes)
Use + to add geometries, e.g. geom_points() for points
Use labs() to modify most labels
ggplot2.qmd


15:00
In the “Practice” section of ggplot2.qmd
Use the mpg data frame and ggplot to create these charts



05:00
Weight:
(e.g. chose all same answers)