scrub_mail: Clean the response from fetched mail

Description Usage Arguments Details Value Examples

Description

Clean the response from fetched mail

Usage

1

Arguments

tbl

A tibble; the result of a call to fetch_mail.

Details

This scrubber converts "Not available"s to NAs, removes dollar signs from prices and converts them to numeric, and splits delivery_day into YYYY-MM-DD delivery_date and delivery_by_time (if present, the time of day by which the mail should arrive).

delivery_date is inferred from the current year.

Value

A tibble with the same number of rows the input. delivery_day becomes delivery_date and delivery_by_time, from which delivery_duration in days is calculated (delivery_date - shipping_date).

Examples

1
2
3
4
5
6
## Not run: 

fetch_mail_flat_rate(origin_zip = "60647",
         destination_zip = "11238", type = "envelope") %>% scrub_mail()

## End(Not run)

aedobbyn/usps documentation built on May 3, 2019, 4:03 p.m.