From 516f35ae45f75c761140f5e9b51c5953b3545324 Mon Sep 17 00:00:00 2001 From: aedobbyn Date: Thu, 5 Jul 2018 19:01:26 -0500 Subject: [PATCH] Rename to postal --- DESCRIPTION | 10 ++++++---- NEWS.md | 4 ++-- R/{usps-package.R => postal-package.R} | 4 ++-- README.Rmd | 22 +++++++++++----------- cran-comments.md | 2 +- man/{usps.Rd => postal.Rd} | 10 +++++----- usps.Rproj => postal.Rproj | 0 vignettes/getting-zoned.Rmd | 10 +++++----- 8 files changed, 32 insertions(+), 30 deletions(-) rename R/{usps-package.R => postal-package.R} (92%) rename man/{usps.Rd => postal.Rd} (80%) rename usps.Rproj => postal.Rproj (100%) diff --git a/DESCRIPTION b/DESCRIPTION index 0e79105..88db8bf 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,16 +1,18 @@ -Package: usps +Package: postal Type: Package Title: United States Postal Service API Interface Version: 0.1.0 Author: Amanda Dobbyn Maintainer: Amanda Dobbyn -Description: Interface to the United States Postal Service Zone Calc API +Description: This package serves as an interface to the United States Postal Service Post Calc and Zone Calc APIs. + It allows users to find the postage price, delivery day, and other information for packages and envelopes, + as well as to find the postal zone for an origin and a destination zip code pair. Depends: R (>= 2.10) License: MIT + file LICENSE Encoding: UTF-8 LazyData: TRUE -URL: https://github.com/aedobbyn/usps/ -BugReports: https://github.com/aedobbyn/usps/issues/ +URL: https://github.com/aedobbyn/postal/ +BugReports: https://github.com/aedobbyn/postal/issues/ Imports: curl, dplyr, diff --git a/NEWS.md b/NEWS.md index b7fc4a4..216731d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# usps 0.1.0 +# postal 0.1.0 -This is the first version of the usps package. +This is the first version of the postal package. diff --git a/R/usps-package.R b/R/postal-package.R similarity index 92% rename from R/usps-package.R rename to R/postal-package.R index cabec73..69d4a7c 100644 --- a/R/usps-package.R +++ b/R/postal-package.R @@ -11,8 +11,8 @@ #' To get postage information, use \code{fetch_mail}. #' To get zones, use \code{get_zone_three_digit} or \code{get_zone_five_digit}. #' -#' The zones vignette can be found with \code{browseVignettes(package = "usps")}. +#' The zones vignette can be found with \code{browseVignettes(package = "postal")}. -#' @name usps +#' @name postal #' @docType package NULL diff --git a/README.Rmd b/README.Rmd index b026187..19ee864 100644 --- a/README.Rmd +++ b/README.Rmd @@ -12,22 +12,22 @@ knitr::opts_chunk$set( ) ``` -# usps `r emo::ji("mailbox")` +# postal `r emo::ji("mailbox")` [![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) -[![Travis build status](https://travis-ci.org/aedobbyn/usps.svg?branch=master)](https://travis-ci.org/aedobbyn/usps) -[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/aedobbyn/usps?branch=master&svg=true)](https://ci.appveyor.com/project/aedobbyn/usps) -[![Coverage status](https://codecov.io/gh/aedobbyn/usps/branch/master/graph/badge.svg)](https://codecov.io/github/aedobbyn/usps?branch=master) +[![Travis build status](https://travis-ci.org/aedobbyn/postal.svg?branch=master)](https://travis-ci.org/aedobbyn/postal) +[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/aedobbyn/postal?branch=master&svg=true)](https://ci.appveyor.com/project/aedobbyn/postal) +[![Coverage status](https://codecov.io/gh/aedobbyn/postal/branch/master/graph/badge.svg)](https://codecov.io/github/aedobbyn/postal?branch=master) Want an estimate of the price of sending a package somewhere via the US Postal Service? Need to get the USPS shipping zone between two zip codes? -Well, this is a `r emo::ji("package")` for your `r emo::ji("package")`s. `usps` provides a tidy interface to the USPS domestic [zone calc](https://postcalc.usps.com/DomesticZoneChart/) and [post calc](https://postcalc.usps.com/Calculator/) APIs. +Well, this is a `r emo::ji("package")` for your `r emo::ji("package")`s. `postal` provides a tidy interface to the USPS domestic [zone calc](https://postcalc.postal.com/DomesticZoneChart/) and [post calc](https://postcalc.postal.com/Calculator/) APIs. ### Installation ```{r, eval=FALSE} # install.packages("devtools") -devtools::install_github("aedobbyn/usps") +devtools::install_github("aedobbyn/postal") ``` @@ -51,7 +51,7 @@ Currently only destinations in the US are supported. Specify a 5-digit origin zip and destination zip, along with the date and time you're going to be shipping (`"today"` and `"now"` are allowed). Other specifics are optionals. ```{r} -library(usps) +library(postal) ``` USPS offers many colorful options to handle all your shipping needs, which are included in the arguments to `fetch_mail`. So to answer the burning question...what if we wanted to ship live animals from Wyoming to Philly by ground on July 2 at 2:30pm in a nonrectangular package?? @@ -210,7 +210,7 @@ origin_zips %>% ``` -Similarly, map over both origin and destination zips and end up at a dataframe. `verbose` gives you a play-by-play if you want it. (More on auto-prepending leading 0s to input zips in the [On Digits](https://github.com/aedobbyn/usps#on-digits) section below.) +Similarly, map over both origin and destination zips and end up at a dataframe. `verbose` gives you a play-by-play if you want it. (More on auto-prepending leading 0s to input zips in the [On Digits](https://github.com/aedobbyn/postal#on-digits) section below.) ```{r} dest_zips <- c("867", "53", "09") @@ -306,7 +306,7 @@ But if you just want to use the equivalent of the ["Get Zone for ZIP Code Pair"] fetch_zones_five_digit("31415", "92653") ``` -Details given when `show_details = TRUE` in `fetch_zones_five_digit` are slightly different than they are for `fetch_zones_three_digit` (see [Details](https://github.com/aedobbyn/usps#details)). +Details given when `show_details = TRUE` in `fetch_zones_five_digit` are slightly different than they are for `fetch_zones_three_digit` (see [Details](https://github.com/aedobbyn/postal#details)).
@@ -362,11 +362,11 @@ zips_zones_sample ``` -The sample is about a quarter of the total number of rows between all origin prefixes and all destination prefixes, plus the 5 digit exceptions (~4m rows). See it put to use in the [vignette](https://github.com/aedobbyn/usps/blob/dev/vignettes/getting-zoned.Rmd). +The sample is about a quarter of the total number of rows between all origin prefixes and all destination prefixes, plus the 5 digit exceptions (~4m rows). See it put to use in the [vignette](https://github.com/aedobbyn/postal/blob/dev/vignettes/getting-zoned.Rmd).
-That's it! [Bug reports](https://github.com/aedobbyn/usps/issues) and PRs welcome! `r emo::ji("mailbox_with_mail")` +That's it! [Bug reports](https://github.com/aedobbyn/postal/issues) and PRs welcome! `r emo::ji("mailbox_with_mail")`

catch_mailman diff --git a/cran-comments.md b/cran-comments.md index fa67090..3b1652b 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -9,5 +9,5 @@ This is a first-time submission. 0 errors | 0 warnings | 0 note ## Downstream dependencies -I have also run R CMD check on downstream dependencies of usps. +I have also run R CMD check on downstream dependencies of postal. All packages that I could install passed. diff --git a/man/usps.Rd b/man/postal.Rd similarity index 80% rename from man/usps.Rd rename to man/postal.Rd index 79cc873..1de12b7 100644 --- a/man/usps.Rd +++ b/man/postal.Rd @@ -1,9 +1,9 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/usps-package.R +% Please edit documentation in R/postal-package.R \docType{package} -\name{usps} -\alias{usps} -\alias{usps-package} +\name{postal} +\alias{postal} +\alias{postal-package} \title{Fetch mail information and zones from USPS} \description{ Calculate shipping rates and times for packages and get the USPS zones corresponding to 3-digit and 5-digit zip code pairs. @@ -17,5 +17,5 @@ Contributors: To get postage information, use \code{fetch_mail}. To get zones, use \code{get_zone_three_digit} or \code{get_zone_five_digit}. -The zones vignette can be found with \code{browseVignettes(package = "usps")}. +The zones vignette can be found with \code{browseVignettes(package = "postal")}. } diff --git a/usps.Rproj b/postal.Rproj similarity index 100% rename from usps.Rproj rename to postal.Rproj diff --git a/vignettes/getting-zoned.Rmd b/vignettes/getting-zoned.Rmd index 6cf98c9..b86265c 100644 --- a/vignettes/getting-zoned.Rmd +++ b/vignettes/getting-zoned.Rmd @@ -20,24 +20,24 @@ library(ggplot2) library(glue) library(dplyr) library(tidyr) -library(usps) +library(postal) library(zipcode) ``` -The `usps::zips_zones_sample` dataset provides a quarter of the ~4 million 3-digit origin-destination pairs. (If you want allll of them, you can run `fetch_all` and put on a pot of coffee.) +The `postal::zips_zones_sample` dataset provides a quarter of the ~4 million 3-digit origin-destination pairs. (If you want allll of them, you can run `fetch_all` and put on a pot of coffee.) What if we wanted to use that to plot how zones increase as the destination gets farther from the origin? -We'll need a measure of latitude and longitude for that. Luckily, data from the [`zipcode`](https://github.com/cran/zipcode) package relates every zip codes to its latitude and longitude. We can that along with the *partial* data in `usps::zips_zones_sample` to match up zips to latitudes and longitudes. +We'll need a measure of latitude and longitude for that. Luckily, data from the [`zipcode`](https://github.com/cran/zipcode) package relates every zip codes to its latitude and longitude. We can that along with the *partial* data in `postal::zips_zones_sample` to match up zips to latitudes and longitudes. -Let's load in the randomly sampled `usps` package data. +Let's load in the randomly sampled `postal` package data. ```{r} data(zips_zones_sample) zips_zones_sample ``` -Later we'll `select` away all the other details and focus just on `origin_zip`, `dest_zip`, and `zone`. As we know, the `usps::zip_zones` data displays all origin zips as 3 digit prefixes and most destination zips as 3 digits as well. +Later we'll `select` away all the other details and focus just on `origin_zip`, `dest_zip`, and `zone`. As we know, the `postal::zip_zones` data displays all origin zips as 3 digit prefixes and most destination zips as 3 digits as well. However, the `zipcode::zipcode` data displays zips in the usual way, as 5 digit.