So I have lists of dates that I cant quite get to be considered dates due to:
Error in charToDate(x) : character string is not in a standard unambiguous format
The data comes in as character vector and converts to unknown after the last line of code. I'd like to eventually order my data by these dates, but because these are treated as character vectors, things dont arrange correctly.
Sample Data: http://www.fast-files.com/getfile.aspx?file=191192 http://www.fast-files.com/getfile.aspx?file=191193
library("xlsx")
library("readxl")
library("dplyr")
library("data.table")
library("tidyverse")
library("lubridate")
library("zoo")
library("stringr")
A <- read_csv("A.csv")
B <- read_csv("B.csv")
C<- rbind(A,B)
C[C=="/ /"]<-NA
as.Date(C$`ROLL OUT SHIP DATE`)
format <- guess_formats(c(C$`ROLL OUT SHIP DATE`), c("mdY", "BdY", "Bdy", "bdY", "bdy", "mdy", "dby"))
C$`ROLL OUT SHIP DATE` <-as.Date(strptime(C$`ROLL OUT SHIP DATE`, format))
a.csv data:
"Due Date","ROLL OUT SHIP DATE","Vendor Ship Date"
"04/01/2019","/ /","02/25/2019"
"06/06/2019","/ /","04/30/2019"
"04/01/2019","/ /","02/25/2019"
"03/09/2019","/ /","/ /"
"03/09/2019","/ /","/ /"
"03/09/2019","/ /","/ /"
"05/01/2019","/ /","03/25/2019"
"05/10/2019","/ /","04/03/2019"
"05/01/2019","/ /","03/25/2019"
"05/10/2019","04/01/2019","04/03/2019"
"04/24/2019","05/01/2019","03/25/2019"
"03/09/2019","/ /","/ /"
"/ /","/ /","/ /"
b.csv:
"Due Date","ROLL OUT SHIP DATE","Vendor Ship Date"
"04/06/2019","04/07/2019","03/13/2019"
"04/21/2019","04/07/2019","04/03/2019"
"03/30/2019","02/18/2019","03/04/2019"
"03/30/2019","/ /","03/04/2019"
"02/10/2019","/ /","/ /"
"04/05/2019","/ /","02/25/2019"
"06/14/2019","/ /","05/01/2019"
"03/08/2019","/ /","01/21/2019"
"03/08/2019","/ /","01/21/2019"
"03/22/2019","/ /","02/04/2019"
"03/31/2019","04/08/2019","02/25/2019"
"08/03/2019","/ /","06/20/2019"
"08/03/2019","/ /","06/20/2019"
"03/04/2019","/ /","/ /"
"07/30/2019","/ /","06/16/2019"
"07/30/2019","/ /","06/23/2019"
"03/25/2019","/ /","/ /"
"03/29/2019","/ /","/ /"
"03/29/2019","/ /","/ /"
"03/29/2019","/ /","/ /"
"03/29/2019","/ /","/ /"
"03/31/2019","/ /","02/25/2019"
"05/14/2019","/ /","04/01/2019"
"06/17/2019","/ /","05/05/2019"
"03/07/2019","/ /","01/20/2019"
"06/07/2019","/ /","05/01/2019"
"03/16/2019","04/08/2019","01/28/2019"
"03/16/2019","/ /","02/05/2019"
"04/11/2019","/ /","03/05/2019"
"05/15/2019","/ /","04/08/2019"
"06/09/2019","/ /","05/03/2019"
"05/08/2019","/ /","04/01/2019"
"06/12/2019","/ /","04/29/2019"
"/ /","/ /","/ /"
"/ /","/ /","/ /"