Skip to content

Commit

Permalink
Adding year to penguins (#62)
Browse files Browse the repository at this point in the history
* rm dontrun

* add year column to penguins

* redocument with year

* update articles
  • Loading branch information
apreshill authored Jul 15, 2020
1 parent 1fc58d6 commit 156daa4
Show file tree
Hide file tree
Showing 9 changed files with 360 additions and 363 deletions.
3 changes: 2 additions & 1 deletion R/penguins.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' size (flipper length, body mass, bill dimensions), and sex.
#' This is a subset of \code{\link{penguins_raw}}.
#'
#' @format A tibble with 344 rows and 7 variables:
#' @format A tibble with 344 rows and 8 variables:
#' \describe{
#' \item{species}{a factor denoting penguin species (Adélie, Chinstrap and Gentoo)}
#' \item{island}{a factor denoting island in Palmer Archipelago, Antarctica (Biscoe, Dream or Torgersen)}
Expand All @@ -13,6 +13,7 @@
#' \item{flipper_length_mm}{an integer denoting flipper length (millimeters)}
#' \item{body_mass_g}{an integer denoting body mass (grams)}
#' \item{sex}{a factor denoting penguin sex (female, male)}
#' \item{year}{an integer denoting the study year (2007, 2008, or 2009)}
#' }
#' @source {Adélie penguins: Palmer Station Antarctica LTER and K. Gorman. 2020. Structural size measurements and isotopic signatures of foraging among adult male and female Adélie penguins (Pygoscelis adeliae) nesting along the Palmer Archipelago near Palmer Station, 2007-2009 ver 5. Environmental Data Initiative} \url{https://doi.org/10.6073/pasta/98b16d7d563f265cb52372c8ca99e60f}
#' @source {Gentoo penguins: Palmer Station Antarctica LTER and K. Gorman. 2020. Structural size measurements and isotopic signatures of foraging among adult male and female Gentoo penguin (Pygoscelis papua) nesting along the Palmer Archipelago near Palmer Station, 2007-2009 ver 5. Environmental Data Initiative} \url{https://doi.org/10.6073/pasta/7fca67fb28d56ee2ffa3d9370ebda689}
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
5 changes: 4 additions & 1 deletion data-raw/penguins.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
library(tidyverse)
library(here)
library(janitor)
library(lubridate)

# Download raw data -------------------------------------------------------

Expand Down Expand Up @@ -29,6 +30,7 @@ penguins_df <- penguins_raw_df %>%
clean_names() %>%
mutate(species_short = word(species, 1)) %>%
mutate(sex = tolower(sex)) %>%
mutate(year = as.integer(lubridate::year(date_egg))) %>%
mutate(across(where(is.character), as.factor)) %>%
mutate(flipper_length_mm = as.integer(flipper_length_mm)) %>%
mutate(body_mass_g = as.integer(body_mass_g)) %>%
Expand All @@ -40,7 +42,8 @@ penguins_df <- penguins_raw_df %>%
bill_depth_mm,
flipper_length_mm,
body_mass_g,
sex) %>%
sex,
year) %>%
rename(species = species_short) %>%
as.data.frame()

Expand Down
Loading

0 comments on commit 156daa4

Please sign in to comment.