Skip to content

Commit

Permalink
Update README and code to k5cents
Browse files Browse the repository at this point in the history
  • Loading branch information
k5cents committed Mar 11, 2024
1 parent 2feb547 commit c93755c
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 34 deletions.
2 changes: 1 addition & 1 deletion R/api.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ wmata_api <- function(path, query = NULL, ..., level, api_key = wmata_key()) {
query = query,
httr::accept_json(),
httr::add_headers(api_key = api_key),
httr::user_agent("https://github.com/kiernann/metro/"),
httr::user_agent("https://github.com/k5cents/metro/"),
terminate_on = c(400:417)
)
if (httr::http_type(resp) != "application/json") {
Expand Down
2 changes: 1 addition & 1 deletion R/rail-position.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ rail_positions <- function(api_key = wmata_key()) {
)
if (length(dat) == 0) {
warning("Using example data until issue is resolved: ",
"https://github.com/kiernann/metro/issues/16")
"https://github.com/k5cents/metro/issues/16")
example_file <- system.file("TrainPositions.json", package = "metro")
dat <- jsonlite::fromJSON(example_file, flatten = TRUE)[[1]]
}
Expand Down
2 changes: 1 addition & 1 deletion R/rail-times.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ rail_times <- function(StationCode = NULL, api_key = wmata_key()) {
)
if (length(dat$Monday$FirstTrains[[1]]) == 0) {
warning("Using example data until issue is resolved: ",
"https://github.com/kiernann/metro/issues/15")
"https://github.com/k5cents/metro/issues/15")
example_file <- system.file("jStationTimes.json", package = "metro")
dat <- jsonlite::fromJSON(example_file)[[1]]
}
Expand Down
14 changes: 7 additions & 7 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Or install the development version from [GitHub][gh]:

```{r install_github, eval=FALSE}
# install.packages("devtools")
devtools::install_github("kiernann/metro")
devtools::install_github("k5cents/metro")
```

## Key
Expand All @@ -62,7 +62,7 @@ The WMATA also provides a [demo key][demo] to try out the various features of
the API. This key should **never** be used in production, it is rate limited and
subject to change at any time.

```{r key}
```{r key, eval=FALSE}
Sys.setenv(WMATA_KEY = "e13626d03d8e4c03ac07f95541b3091b")
```

Expand Down Expand Up @@ -122,14 +122,14 @@ metro_lines # rail_lines() for live
[life_link]: https://lifecycle.r-lib.org/articles/stages.html#stable
[cran_badge]: https://www.r-pkg.org/badges/version/metro
[cran_link]: https://CRAN.R-project.org/package=metro
[ga_badge]: https://github.com/kiernann/metro/workflows/R-CMD-check/badge.svg
[ga_link]: https://github.com/kiernann/metro/actions
[cov_badge]: https://img.shields.io/codecov/c/github/kiernann/metro/master.svg
[cov_link]: https://app.codecov.io/gh/kiernann/metro?branch=master'
[ga_badge]: https://github.com/k5cents/metro/workflows/R-CMD-check/badge.svg
[ga_link]: https://github.com/k5cents/metro/actions
[cov_badge]: https://img.shields.io/codecov/c/github/k5cents/metro/master.svg
[cov_link]: https://app.codecov.io/gh/k5cents/metro?branch=master'
[dl_badge]: https://cranlogs.r-pkg.org/badges/grand-total/gluedown
[tidy]: https://en.wikipedia.org/wiki/Tidy_data
[cran]: https://cran.r-project.org/package=metro
[gh]: https://github.com/kiernann/metro
[gh]: https://github.com/k5cents/metro
[demo]: https://developer.wmata.com/products/5475f236031f590f380924ff
[gd]: https://github.com/hypertidy/geodist
[hms]: https://github.com/tidyverse/hms
Expand Down
37 changes: 18 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ experimental](https://img.shields.io/badge/lifecycle-stable-green)](https://life
status](https://www.r-pkg.org/badges/version/metro)](https://CRAN.R-project.org/package=metro)
![Downloads](https://cranlogs.r-pkg.org/badges/grand-total/gluedown)
[![Codecov test
coverage](https://img.shields.io/codecov/c/github/kiernann/metro/master.svg)](https://app.codecov.io/gh/kiernann/metro?branch=master')
coverage](https://img.shields.io/codecov/c/github/k5cents/metro/master.svg)](https://app.codecov.io/gh/k5cents/metro?branch=master')
[![R build
status](https://github.com/kiernann/metro/workflows/R-CMD-check/badge.svg)](https://github.com/kiernann/metro/actions)
status](https://github.com/k5cents/metro/workflows/R-CMD-check/badge.svg)](https://github.com/k5cents/metro/actions)
<!-- badges: end -->

The goal of metro is to return data frames from the Washington
Expand All @@ -31,11 +31,11 @@ install.packages("metro")
```

Or install the development version from
[GitHub](https://github.com/kiernann/metro):
[GitHub](https://github.com/k5cents/metro):

``` r
# install.packages("devtools")
devtools::install_github("kiernann/metro")
devtools::install_github("k5cents/metro")
```

## Key
Expand All @@ -59,7 +59,7 @@ Sys.setenv(WMATA_KEY = "e13626d03d8e4c03ac07f95541b3091b")
``` r
library(metro)
packageVersion("metro")
#> [1] '0.9.2'
#> [1] '0.9.3'
```

Functions return data frames for easy analysis.
Expand All @@ -69,12 +69,12 @@ next_train(StationCodes = "A01")
#> # A tibble: 6 × 9
#> Car Destination DestinationCode DestinationName Group Line LocationCode LocationName Min
#> <int> <chr> <chr> <chr> <int> <chr> <chr> <chr> <int>
#> 1 6 Glenmont B11 Glenmont 1 RD A01 Metro Center -1
#> 2 6 Shady Grove <NA> Shady Grove 2 RD A01 Metro Center -1
#> 3 8 Glenmont B11 Glenmont 1 RD A01 Metro Center 1
#> 4 8 Glenmont B11 Glenmont 1 RD A01 Metro Center 6
#> 5 6 Shady Grove <NA> Shady Grove 2 RD A01 Metro Center 6
#> 6 6 Shady Grove <NA> Shady Grove 2 RD A01 Metro Center 18
#> 1 6 Glenmont B11 Glenmont 1 RD A01 Metro Center 0
#> 2 8 Friendship <NA> Friendship 2 RD A01 Metro Center 3
#> 3 6 Glenmont B11 Glenmont 1 RD A01 Metro Center 8
#> 4 8 Friendship <NA> Friendship 2 RD A01 Metro Center 10
#> 5 8 Glenmont B11 Glenmont 1 RD A01 Metro Center 15
#> 6 8 Friendship <NA> Friendship 2 RD A01 Metro Center 18
```

### Coordinates
Expand Down Expand Up @@ -104,16 +104,15 @@ the UTC time zone (+5 hours).

``` r
bus_position(RouteId = "33")[, 1:8]
#> # A tibble: 7 × 8
#> # A tibble: 6 × 8
#> VehicleID Lat Lon Distance Deviation DateTime TripID RouteID
#> <chr> <dbl> <dbl> <dbl> <dbl> <dttm> <chr> <chr>
#> 1 4611 38.9 -77.0 NA 22 2023-11-10 00:14:31 29636020 33
#> 2 7116 39.0 -77.1 NA 0 2023-11-10 00:14:08 18078020 33
#> 3 4572 38.9 -77.0 NA 14 2023-11-10 00:14:16 29847020 33
#> 4 7111 39.0 -77.1 NA -3 2023-11-10 00:14:08 46929020 33
#> 5 4583 38.9 -77.1 NA 6 2023-11-10 00:14:15 16581020 33
#> 6 7107 38.8 -77.4 NA 32 2023-11-10 00:14:35 6694020 33
#> 7 7134 38.9 -77.0 NA 9 2023-11-10 00:14:30 26108020 33
#> 1 4566 38.9 -77.0 NA 4 2024-03-11 02:50:44 9684010 33
#> 2 7122 38.9 -77.1 NA 6 2024-03-11 02:50:45 1031010 33
#> 3 4794 38.9 -77.1 NA 8 2024-03-11 02:50:44 18769010 33
#> 4 4589 38.9 -77.1 NA 0 2024-03-11 02:50:50 30442010 33
#> 5 4786 39.0 -77.1 NA 8 2024-03-11 02:51:00 10847010 33
#> 6 4781 38.9 -77.0 NA 2 2024-03-11 02:50:43 47206010 33
```

Time values are left in Eastern time and are represented using the class
Expand Down
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
url: https://kiernann.com/metro
url: https://k5cents.github.io/metro
8 changes: 4 additions & 4 deletions man/metro-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c93755c

Please sign in to comment.