This file contains hidden or 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
| # Vehicles from the GSA have a gross vehicle weight rating (GVWR), but this is stored in the vehicle description in inconsistent | |
| # text formats (sometimes spaces as separators, sometimes commas, sometimes no separators). One consistent thing is that the weights | |
| # always end with 'LBS', which means it's easy enough to write a regex that can extract them from the text. | |
| # Same GSA vehicle description | |
| sample_text <- c("4x4 SUV 10,000 LBS GVWR", "2x4 PICKUP 7 001 LBS GVWR", "SEDAN 6000LBS") | |
| # using {stringr} and regex: | |
| library(stringr) | |
| library(magrittr) |
This file contains hidden or 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
| library(lubridate) | |
| # One Scaramucci is apx 10 days | |
| mooch <- days(10) | |
| # Date of the Confederate Provisional Constitution | |
| conf_start <- ymd("1861/02/08") | |
| # Date of surrender | |
| conf_end <- ymd("1865/04/09") |