Skip to content

Instantly share code, notes, and snippets.

@jthomasmock
Created August 27, 2021 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jthomasmock/771853602d5b15662a36eca237e2113d to your computer and use it in GitHub Desktop.
Save jthomasmock/771853602d5b15662a36eca237e2113d to your computer and use it in GitHub Desktop.
````md
---
title: "Penguins"
date: 2020-08-11
output: html_document
params:
species: Adelie
---
```{r setup, include = FALSE}`r ''`
library(tidyverse)
library(palmerpenguins)
smaller <- penguins %>%
filter(species == params$species,
!is.na(body_mass_g))
```
We have data about `r knitr::inline_expr("nrow(penguins)")` penguins. Only
`r knitr::inline_expr("nrow(penguins) - nrow(smaller)")` are classified as
`r knitr::inline_expr("params$species")`. The distribution of the
`r knitr::inline_expr("params$species")` penguins are shown below:
```{r, echo = FALSE}`r ''`
smaller %>%
ggplot(aes(body_mass_g)) +
geom_histogram(binwidth = 100)
```
````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment