Skip to content

Instantly share code, notes, and snippets.

@ChristinaLK
Created April 12, 2024 22:45
Show Gist options
  • Save ChristinaLK/4202db48b593bb4f9fef536ecd182634 to your computer and use it in GitHub Desktop.
Save ChristinaLK/4202db48b593bb4f9fef536ecd182634 to your computer and use it in GitHub Desktop.
Palmer Penguins Sample R Code
library(palmerpenguins)
library(dplyr)
library(readr)
penguins %>%
filter(species == "Chinstrap") %>%
select(island, body_mass_g, year) %>%
group_by(island, year) %>%
summarize(avg_body_mass_g = mean(body_mass_g)) %>%
write_csv("chinstrap_avg_weights.csv")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment