-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* updating a few datasets * fixed the time in the paralympic dataset * fixing the variable names * temperature data, 1950 and 2022 * Update paralympic data prep and example * Document paralympic data * Document NYC marathon data * Update 2022 durham pm25 data + align 2011 data * Update pipe * Update pipe * Run document * Add type variable to docs * Fix data prep issues and add pkgs ex depends on * Move US temp data to usdata pkg * Ungroup data in example * Add new datasets to pkgdown site --------- Co-authored-by: Mine Çetinkaya-Rundel <cetinkaya.mine@gmail.com>
- Loading branch information
1 parent
6fac392
commit 8ab1ca4
Showing
28 changed files
with
889 additions
and
152 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#' Race time for Olympic and Paralympic 1500m. | ||
#' | ||
#' Compiled gold medal times for the 1500m race in the Olympic Games and the | ||
#' Paralympic Games. The times given for contestants competing in | ||
#' the Paralympic Games are for athletes with different visual impairments; | ||
#' T11 indicates fully blind (with an option to race with a guide-runner) | ||
#' with T12 and T13 as lower levels of visual impairment. | ||
#' | ||
#' | ||
#' @name paralympic_1500 | ||
#' @docType data | ||
#' @format A data frame with 83 rows and 10 variables. | ||
#' \describe{ | ||
#' \item{year}{Year the games took place.} | ||
#' \item{city}{City of the games.} | ||
#' \item{country_of_games}{Country of the games.} | ||
#' \item{division}{Division: `Men` or `Women`.} | ||
#' \item{type}{Type.} | ||
#' \item{name}{Name of the athlete.} | ||
#' \item{country_of_athlete}{Country of athlete.} | ||
#' \item{time}{Time of gold medal race, in m:s.} | ||
#' \item{time_min}{Time of gold medal race, in decimal minutes (min + sec/60).} | ||
#' } | ||
#' @source [https://www.paralympic.org/](https://www.paralympic.org/) and [https://en.wikipedia.org/wiki/1500_metres_at_the_Olympics](https://en.wikipedia.org/wiki/1500_metres_at_the_Olympics). | ||
#' @keywords datasets | ||
#' @examples | ||
#' | ||
#' library(ggplot2) | ||
#' library(dplyr) | ||
#' | ||
#' paralympic_1500 |> | ||
#' mutate( | ||
#' sight_level = case_when( | ||
#' type == "T11" ~ "total impairment", | ||
#' type == "T12" ~ "some impairment", | ||
#' type == "T13" ~ "some impairment", | ||
#' type == "Olympic" ~ "no impairment" | ||
#' ) | ||
#' ) |> | ||
#' filter(division == "Men", year > 1920) |> | ||
#' filter(type == "Olympic" | type == "T11") |> | ||
#' ggplot(aes(x = year, y = time_min, color = sight_level, shape = sight_level)) + | ||
#' geom_point() + | ||
#' scale_x_continuous(breaks = seq(1924, 2020, by = 8)) + | ||
#' labs( | ||
#' title = "Men's Olympic and Paralympic 1500m race times", | ||
#' x = "Year", | ||
#' y = "Time of Race (minutes)", | ||
#' color = "Sight level", | ||
#' shape = "Sight level" | ||
#' ) | ||
#' | ||
"paralympic_1500" |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#' Air quality for Durham, NC | ||
#' | ||
#' Daily air quality is measured by the air quality index (AQI) reported by the | ||
#' Environmental Protection Agency in 2022. | ||
#' | ||
#' | ||
#' @name pm25_2022_durham | ||
#' @docType data | ||
#' @format A data frame with 356 observations on the following 20 variables. | ||
#' \describe{ | ||
#' \item{date}{Date.} | ||
#' \item{aqs_site_id}{The numeric site ID.} | ||
#' \item{poc}{A numeric vector, the Parameter Occurance Code.} | ||
#' \item{daily_mean_pm2_5_concentration}{A numeric vector with the average daily concentration of fine particulates, or particulate matter 2.5.} | ||
#' \item{units}{A character vector with value \code{ug/m3 LC}.} | ||
#' \item{daily_aqi_value}{A numeric vector with the daily air quality index.} | ||
#' \item{daily_obs_count}{A numeric vector.} | ||
#' \item{percent_complete}{A numeric vector.} | ||
#' \item{aqs_parameter_code}{A numeric vector.} | ||
#' \item{aqs_parameter_desc}{A factor vector with level \code{PM2.5 - Local Conditions}.} | ||
#' \item{cbsa_code}{A numeric vector.} | ||
#' \item{cbsa_name}{A character vector with value \code{Durham-Chapel Hill, NC}.} | ||
#' \item{state_code}{A numeric vector.} | ||
#' \item{state}{A character vector with value \code{North Carolina}.} | ||
#' \item{county_code}{A numeric vector.} | ||
#' \item{county}{A character vector with value \code{Durham}.} | ||
#' \item{site_latitude}{A numeric vector of the latitude.} | ||
#' \item{site_longitude}{A numeric vector of the longitude.} | ||
#' \item{site_name}{A character vector with value \code{Durham Armory}.} | ||
#' } | ||
#' @source US Environmental Protection Agency, AirData, 2022. | ||
#' \url{http://www3.epa.gov/airdata/ad_data_daily.html} | ||
#' @keywords datasets | ||
#' @examples | ||
#' | ||
#' library(ggplot2) | ||
#' | ||
#' ggplot(pm25_2022_durham, aes(x = date, y = daily_mean_pm2_5_concentration, group = 1)) + | ||
#' geom_line() | ||
"pm25_2022_durham" |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# load packages ---------------------------------------------------------------- | ||
|
||
library(tidyverse) | ||
|
||
# load data -------------------------------------------------------------------- | ||
|
||
paralympic_1500_raw <- read_csv(here::here("data-raw/paralympic_1500/paralympic_1500.csv")) | ||
|
||
# cleaning --------------------------------------------------------------------- | ||
|
||
paralympic_1500 <- paralympic_1500_raw |> | ||
mutate(time_min = time) |> | ||
mutate(time = paste(min, sec, sep = ":")) |> | ||
select(-min, -sec) | ||
|
||
# save data -------------------------------------------------------------------- | ||
|
||
usethis::use_data(paralympic_1500, overwrite = TRUE) |
Oops, something went wrong.