Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
^_pkgdown\.yml$
^\.github$
^\.lintr$
^\.Rproj\.user$
^docs$
^LICENSE\.md$
^mspflights\.Rproj$
^pkgdown$
^README\.Rmd$
^renv\.lock$
^renv$
^TODO\.md$
26 changes: 26 additions & 0 deletions .Rprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
source("renv/activate.R")

options(
warnPartialMatchArgs = TRUE,
warnPartialMatchAttr = TRUE,
warnPartialMatchDollar = TRUE,
styler.cache_root = "styler-perm"
)

# attach devtools and set options per https://r-pkgs.org/setup.html
if (interactive()) {
suppressMessages(require(devtools))
suppressMessages(require(rdev))
if (!suppressMessages(suppressWarnings(require(pkgload::pkg_name("."), character.only = TRUE)))) {
devtools::load_all(".")
}
# install pre-commit git hook when cloning repository
if (!fs::file_exists(".git/hooks/pre-commit")) {
cat("git hook pre-commit missing, installing...\n")
usethis::use_git_hook(
"pre-commit", readLines(fs::path_package("rdev", "templates", "pre-commit"))
)
}
# warn if pandoc not found in PATH
if (Sys.which("pandoc") == "") warning("pandoc not found, run `open /Applications/RStudio.app`")
}
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
56 changes: 56 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
#
# https://github.com/r-lib/actions/blob/v2/examples/check-standard.yaml
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
# - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
# - {os: ubuntu-latest, r: 'release'}
# - {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
# disable Posit package manager
use-public-rspm: false
# uncomment next line if windows build fails per https://github.com/r-lib/actions/issues/585
# rtools-version: '42'

- uses: r-lib/actions/setup-renv@v2
- name: Install rcmdcheck
run: renv::install("rcmdcheck")
shell: Rscript {0}

- uses: r-lib/actions/check-r-package@v2
with:
# see https://github.com/r-hub/rhub/issues/476 for --no-multiarch
args: 'c("--no-manual", "--no-multiarch")'
upload-snapshots: true
33 changes: 33 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
#
# https://github.com/r-lib/actions/blob/v2/examples/lint.yaml
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: lint

jobs:
lint:
runs-on: macos-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2

- uses: r-lib/actions/setup-renv@v2
- name: Install dependencies
run: renv::install(c("lintr", "."))
shell: Rscript {0}

- name: Lint all files
run: lintr::lint_dir(path = ".", exclusions = list("renv", "packrat", "R/RcppExports.R"))
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true
32 changes: 32 additions & 0 deletions .github/workflows/missing-deps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: missing-deps

jobs:
missing-deps:
runs-on: macos-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2

- uses: r-lib/actions/setup-renv@v2
- name: Install dependencies
run: renv::install("jabenninghoff/rdev")
shell: Rscript {0}

- name: Find missing dependencies
run: |
mdeps <- rdev::missing_deps()
mdeps
stopifnot(nrow(mdeps) == 0)
shell: Rscript {0}
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ vignettes/*.pdf
# R Environment Variables
.Renviron

# pkgdown site
docs/

# translation temp files
po/*~

# RStudio Connect folder
rsconnect/

# macOS, vim
.DS_Store
*.swp
~$*
19 changes: 19 additions & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
linters: linters_with_tags(
tags = NULL,
extraction_operator_linter = NULL,
implicit_integer_linter = NULL,
line_length_linter(100),
missing_package_linter = NULL,
namespace_linter = NULL,
nonportable_path_linter = NULL,
paste_linter(allow_file_path = "always"),
todo_comment_linter = NULL,
undesirable_function_linter(
within(all_undesirable_functions, rm(ifelse, library, require, structure))
),
undesirable_operator_linter(all_undesirable_operators),
unnecessary_concatenation_linter(allow_single_expression = FALSE),
unused_import_linter(
except_packages = c("bit64", "data.table", "tidyverse", pkgload::pkg_name("."))
)
)
48 changes: 48 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Package: mspflights
Title: Flights Between MSP and LIT, STL from April 2013 to February 2015
Version: 0.0.1
Authors@R:
person("John", "Benninghoff", , "jbenninghoff@mac.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-6230-4742"))
Description: Airline on-time data for all flights departing from or
arriving to MSP, LIT, and STL between April 2013 and February 2015.
Also includes useful 'metadata' on airlines, airports, weather, and
planes.
License: MIT + file LICENSE
URL: https://jabenninghoff.github.io/mspflights/,
https://github.com/jabenninghoff/mspflights
BugReports: https://github.com/jabenninghoff/mspflights/issues
Depends:
R (>= 3.5.0)
Imports:
tibble
Suggests:
desc,
devtools,
dplyr,
fs,
ggplot2,
httr,
knitr,
lubridate,
pkgdown,
pkgload,
purrr,
rdev (>= 1.10.1),
readr,
rmarkdown,
spelling,
stringi,
svglite,
testthat (>= 3.0.0),
usethis,
withr
Remotes:
jabenninghoff/rdev
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-US
LazyData: true
LazyDataCompression: bzip2
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2024 mspflights authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generated by roxygen2: do not edit by hand

importFrom(tibble,tibble)
13 changes: 13 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# mspflights 0.0.1

Initial release implementing an updated version of [nycflights13](https://nycflights13.tidyverse.org):

* Imported nycflights13 code and data

* Updated nycflights13 data using [tidyverse/nycflights13#53](https://github.com/tidyverse/nycflights13/pull/53)

* Updated all data from current sources

* Code and data cleanup

Future releases will create data for travel between MSP and LIT, and MSP and STL between April 2013 and February 2015.
13 changes: 13 additions & 0 deletions R/airlines.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#' Airline names
#'
#' Look up airline names from their carrier codes.
#'
#' @source <https://www.transtats.bts.gov/DL_SelectFields.aspx?gnoyr_VQ=FGJ&QO_fu146_anzr=b0-gvzr>
#' @format Data frame with columns
#' \describe{
#' \item{carrier}{Two letter abbreviation.}
#' \item{name}{Full name.}
#' }
#' @examples
#' airlines
"airlines"
30 changes: 30 additions & 0 deletions R/airport.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#' Airport metadata
#'
#' Useful metadata about airports.
#'
#' @source <https://openflights.org>, downloaded 2014-06-27
#' @format A data frame with columns:
#' \describe{
#' \item{faa}{FAA airport code.}
#' \item{name}{Usual name of the airport.}
#' \item{lat, lon}{Location of airport.}
#' \item{alt}{Altitude, in feet.}
#' \item{tz}{Timezone offset from GMT.}
#' \item{dst}{Daylight savings time zone. A = Standard US DST: starts on the
#' second Sunday of March, ends on the first Sunday of November.
#' U = unknown. N = no dst.}
#' \item{tzone}{IANA time zone, as determined by GeoNames webservice.}
#' }
#' @examples
#' airports
#'
#' if (require("dplyr")) {
#' airports %>%
#' rename(dest = faa) %>%
#' semi_join(flights)
#' flights %>% anti_join(airports %>% rename(dest = faa))
#' airports %>%
#' rename(origin = faa) %>%
#' semi_join(flights)
#' }
"airports"
32 changes: 32 additions & 0 deletions R/flights.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#' Flights data
#'
#' On-time data for all flights that departed NYC (i.e. JFK, LGA or EWR) in
#' 2013.
#'
#' @source RITA, Bureau of transportation statistics,
#' <https://www.transtats.bts.gov/DL_SelectFields.aspx?gnoyr_VQ=FGJ&QO_fu146_anzr=b0-gvzr>
#' @format Data frame with columns
#' \describe{
#' \item{year, month, day}{Date of departure.}
#' \item{dep_time, arr_time}{Actual departure and arrival times (format HHMM or HMM), local tz.}
#' \item{sched_dep_time, sched_arr_time}{Scheduled departure and arrival times (format HHMM or HMM),
#' local tz.}
#' \item{dep_delay, arr_delay}{Departure and arrival delays, in minutes.
#' Negative times represent early departures/arrivals.}
#' \item{carrier}{Two letter carrier abbreviation. See [`airlines`]
#' to get name.}
#' \item{flight}{Flight number.}
#' \item{tailnum}{Plane tail number. See [`planes`] for additional metadata.}
#' \item{origin, dest}{Origin and destination. See [`airports`] for
#' additional metadata.}
#' \item{air_time}{Amount of time spent in the air, in minutes.}
#' \item{distance}{Distance between airports, in miles.}
#' \item{hour, minute}{Time of scheduled departure broken into hour and minutes.}
#' \item{time_hour}{Scheduled date and hour of the flight as a `POSIXct` date.
#' Along with `origin`, can be used to join flights data to [`weather`] data.}
#' }
"flights"


#' @importFrom tibble tibble
NULL
2 changes: 2 additions & 0 deletions R/package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#' @keywords internal
"_PACKAGE"
Loading