Created
February 9, 2026 13:05
-
-
Save susanBuck/570d4c9396281d2ca4ac46f3d43e6f4b to your computer and use it in GitHub Desktop.
Example Quarto File
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| title: Motor Trend Cars Data | |
| format: html | |
| --- | |
| ```{r} | |
| #| label: load-packages | |
| #| include: false | |
| library(tidyverse) | |
| ``` | |
| ## Meet the cars | |
| The mtcars dataset contains fuel consumption and design characteristics for `{r} nrow(mtcars)` cars from the 1970s. | |
| This dataset is built into R and is commonly used for teaching data analysis and visualization. | |
| @fig-plot-mtcars shows the relationship between a car’s weight and its fuel efficiency. | |
| ```{r} | |
| #| label: fig-plot-mtcars | |
| #| fig-cap: Fuel efficiency vs weight for cars in the mtcars dataset | |
| #| warning: false | |
| #| echo: false | |
| ggplot(mtcars, | |
| aes(x = wt, y = mpg)) + | |
| geom_point(aes(color = factor(cyl)), size = 2) + | |
| labs( | |
| x = "Weight (1000 lbs)", | |
| y = "Miles per gallon", | |
| color = "Number of cylinders" | |
| ) + | |
| theme_minimal() | |
| ``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment