无法使用lubridate或as.date

时间:2017-06-02 20:49:33

标签: r

相关的输入:

structure(list(`Send Offer Letter` = c("1/1/2001", "1/1/2001", 
"1/1/2001", "1/1/2001", "1/1/2001", "1/1/2001", "1/1/2001", "1/1/2001", 
"1/1/2001", "1/1/2001", "1/1/2001", "1/1/2001", "1/1/2001", "1/1/2001", 
"1/1/2001", "1/1/2001", "5/21/2008", "5/14/2008", "5/16/2008", 
"5/20/2008", "6/13/2008", "6/20/2008", "6/27/2008", "6/27/2008", 
"7/14/2008", "7/19/2008", "7/30/2008", "8/19/2008", "8/25/2008", 
"9/12/2008", "9/12/2008", "9/29/2008", "10/13/2008", "10/22/2008", 
"11/14/2008", "11/26/2008", "12/24/2008", "4/15/2009", "4/15/2009", 
"4/17/2009", "5/1/2009", "5/12/2009", "5/10/2009", "1/1/2001", 
"1/1/2001", "7/10/2009", "7/23/2009", "7/23/2009", "7/23/2009", 
"7/24/2009", "8/7/2009", "8/20/2009", "9/3/2009", "9/8/2009", 
"9/18/2009", "9/28/2009", "11/6/2009", "1/1/2001", "1/1/2001", 
"1/1/2001", "11/13/2009", "12/1/2009", "12/4/2009", "1/28/2010", 
"1/8/2010", "1/13/2010", "1/15/2010", "2/1/2010", "2/15/2010", 
"2/15/2010", "2/11/2010", "3/15/2010", "3/23/2010", "3/25/2010", 
"3/19/2010", "3/19/2010", "3/19/2010", "3/26/2010", "3/29/2010", 
"3/30/2010", "4/6/2010", "4/9/2010", "4/9/2010", "4/12/2010", 
"4/15/2010", "4/6/2010", "4/22/2010", "5/13/2010", "5/13/2010", 
"1/1/2001", "5/26/2010", "1/1/2001", "6/11/2010", "6/14/2010", 
"6/31/2010", "6/31/2010", "7/9/2010", "7/16/2010", "1/1/2001", 
"8/23/2010", "9/7/2010", "9/7/2010", "10/13/2010", "10/20/2010", 
"10/21/2010", "1/1/2001", "1/1/2001", "11/29/2010", "1/25/2011", 
"2/4/2011", "2/25/2011", "2/10/2011", "3/7/2011", "1/1/2001", 
"3/14/2011", "4/5/2011", "4/6/2011", "4/6/2011", "4/19/2011", 
"1/1/2001", "4/26/2011", "4/22/2011", "4/22/2011", "4/19/2011", 
"4/22/2011", "4/27/2011", "4/29/2011", "5/16/2011", "5/16/2011", 
"5/31/2011", "5/27/2011", "6/2/2011", "6/3/2011", "6/14/2011", 
"6/10/2011", "6/20/2011", "6/28/2011", "7/8/2011", "7/15/2011", 
"7/19/2011", "7/20/2011", "8/8/2011", "8/31/2011", "8/29/2011", 
"9/2/2011", "9/7/2011", "9/9/2011", "9/22/2011", "9/26/2011", 
"9/30/2011", "9/29/2011", "9/30/2011", "10/6/2011", "10/14/2011", 
"10/27/2011", "10/7/2011", "10/25/2011", "10/12/2011", "11/15/2011", 
"11/9/2011", "11/22/2011", "11/22/2011", "12/16/2011", "12/16/2011", 
"1/1/2001", "12/29/2011", "1/12/2012", "1/5/2012", "1/1/2001", 
"1/12/2012", "1/17/2012", "1/17/2012", "1/30/2012", "1/30/2012", 
"1/30/2012", "2/2/2012", "2/2/2012", "2/9/2012", "2/13/2012", 
"2/24/2012", "3/1/2012", "3/2/2012", "3/14/2012", "3/12/2012", 
"3/22/2012", "3/22/2012", "3/23/2012", "3/27/2012", "3/28/2012", 
"3/28/2012", "3/28/2012", "4/2/2012", "4/3/2012", "4/6/2012", 
"4/11/2012", "4/6/2012", "4/19/2012", "4/24/2012", "4/13/2012", 
"4/20/2012", "4/20/2012", "4/12/2012", "4/19/2012", "5/2/2012", 
"5/14/2012", "4/19/2012", "4/30/2012", "5/4/2012", "4/25/2012", 
"5/10/2012", "5/10/2012", "5/10/2012", "5/10/2012", "5/15/2012", 
"5/10/2012", "5/17/2012", "5/2/2012", "5/31/2012", "5/26/2012", 
"6/4/2012", "7/23/2012", "7/20/2012", "7/18/2012", "7/20/2012", 
"7/25/2012", "7/9/2012", "8/2/2012", "8/6/2012", "8/20/2012", 
"8/27/2012", "9/13/2012", "1/1/2001", "10/23/2012", "10/19/2012", 
"10/30/2012", "11/9/2012", "11/9/2012", "11/21/2012", "12/3/2012", 
"12/4/2012", "12/5/2012", "12/5/2012", "12/11/2012", "12/27/2012", 
"1/3/2013", "1/14/2013", "1/16/2013", "1/23/2013", "1/23/2013", 
"1/28/2013", "1/22/2013", "1/29/2013", "2/12/2013", "2/15/2013", 
"2/15/2013", "2/15/2013", "2/20/2013", "3/15/2013", "3/15/2013", 
"3/12/2013", "2/28/2013", "3/6/2013", "3/5/2013", "3/15/2013", 
"2/26/2013", "3/18/2013", "3/27/2013", "3/15/2013", "3/18/2013", 
"3/22/2013", "3/29/2013", "3/29/2013", "3/28/2013", "5/22/2013", 
"3/28/2013", "4/2/2013", "4/3/2013", "4/3/2013", "4/3/2013", 
"4/15/2013", "4/16/2013", "4/19/2013", "4/22/2013", "4/23/2013", 
"4/23/2013", "5/1/2013", "5/2/2013", "5/3/2013", "4/30/2013", 
"5/29/2013", "5/28/2013", "1/1/2001", "6/14/2013", "6/14/2013", 
"6/21/2013", "6/18/2013", "6/25/2013", "6/26/2013", "6/26/2013", 
"6/15/2013", "7/1/2013", "7/11/2013", "7/11/2013", "7/17/2013", 
"7/18/2013", "7/18/2013", "7/29/2013", "8/5/2013", "8/8/2013", 
"8/9/2013", "8/21/2013", "8/22/2013", "8/22/2013", "9/4/2013", 
"9/12/2013", "9/10/2013", "9/23/2013", "9/30/2013", "9/23/2013", 
"10/1/2013", "10/4/2013", "10/9/2013", "10/10/2013", "10/12/2013", 
"10/28/2013", "10/29/2013", "10/29/2013", "10/31/2013", "10/28/2013", 
"11/5/2013", "11/19/2013", "12/3/2013", "12/3/2013", "12/4/2013", 
"12/5/2013", "12/5/2013", "12/13/2013", "12/16/2013", "12/17/2013", 
"12/20/2013", "1/1/2001", "1/2/2014", "1/7/2014", "1/17/2014", 
"1/15/2014", "1/31/2014", "2/3/2014", "2/3/2014", "2/3/2014", 
"2/4/2014", "2/4/2014", "1/31/2014", "2/14/2014", "2/27/2014", 
"2/28/2014", "2/28/2014", "3/3/2014", "3/5/2014", "3/5/2014", 
"3/5/2014", "3/5/2014", "3/5/2014", "3/14/2014", "3/14/2014", 
"3/20/2014", "1/1/2001", "4/3/2014", "4/10/2014", "4/11/2014", 
"3/31/2014", "4/18/2014", "4/18/2014", "4/22/2014", "4/22/2014", 
"5/7/2014", "5/9/2014", "5/14/2014", "5/16/2014", "5/8/2014", 
"6/6/2014", "6/5/2014", "6/11/2014", "7/9/2014", "7/9/2014", 
"6/16/2014", "7/7/2014", "7/11/2014", "7/16/2014", "7/25/2014", 
"7/29/2014", "8/13/2014", "8/25/2014", "8/29/2014", "8/19/2014", 
"9/17/2014", "9/26/2014", "10/1/2014", "10/7/2014", "10/14/2014", 
"10/17/2014", "10/22/2014", "10/27/2014", "10/24/2014", "10/7/2014", 
"11/22/2014", "11/20/2014", "11/25/2014", "11/26/2014", "12/2/2014", 
"11/17/2014", "12/10/2014", "12/15/2014", "1/14/2015", "1/22/2015", 
"1/27/2015", "1/27/2015", "2/3/2015", "2/2/2015", "2/20/2015", 
"3/2/2015", "3/9/2015", "3/9/2015", "3/11/2015", "3/23/2015", 
"3/24/2015", "3/26/2015", "4/7/2015", "4/7/2015", "4/7/2015", 
"4/10/2015", "4/16/2015", "4/17/2015", "4/21/2015", "4/26/2015", 
"4/29/2015", "5/4/2015", "5/20/2015", "5/20/2015", "5/22/2015", 
"5/27/2015", "6/2/2015", "6/5/2015", "1/1/2001", "6/15/2015", 
"6/19/2015", "6/18/2015", "6/29/2015", "6/30/2015", "6/14/2015", 
"7/20/2015", "7/20/2015", "7/22/2015", "7/28/2015", "8/14/2015", 
"8/31/2015", "9/1/2015", "8/11/2015", "8/31/2015", "9/1/2015", 
"9/9/2015", "9/9/2015", "9/21/2015", "9/21/2015", "10/7/2015", 
"10/12/2015", "10/12/2015", "10/15/2015", "10/16/2015", "10/19/2015", 
"10/16/2015", "10/16/2015", "10/23/2015", "11/13/2015", "11/13/2015", 
"11/17/2015", "11/20/2015", "11/20/2015", "12/1/2015", "12/4/2015", 
"11/30/2015", "11/25/2015", "12/14/2015", "12/15/2015", "11/20/2015", 
"12/18/2015", "12/21/2015", "12/23/2015", "12/23/2015", "12/23/2015", 
"12/23/2015", "12/28/2015", "12/29/2015", "12/28/2015", "1/6/2016", 
"1/5/2016", "1/6/2016", "1/6/2016", "1/8/2016", "1/11/2016", 
"1/11/2016", "1/11/2016", "1/11/2016", "1/15/2016", "1/21/2016", 
"1/25/2016", "1/29/2016", "2/8/2016", "2/10/2016", "2/15/2016", 
"2/15/2016", "2/16/2016", "2/19/2016", "2/24/2016", "2/23/2016", 
"2/24/2016", "2/29/2016", "3/3/2016", "3/10/2016", "3/15/2016", 
"3/15/2016", "3/22/2016", "3/24/2016", "3/30/2016", "4/11/2016", 
"4/6/2016", "4/12/2016", "4/15/2016", "4/18/2016", "4/20/2016", 
"5/3/2016", "5/4/2016", "5/11/2016", "5/27/2016", "5/27/2016", 
"5/20/2016", "3/15/2016", "3/3/2016", "6/10/2016", "6/15/2016", 
"6/17/2016", "6/28/2016", "6/28/2016", "6/28/2016", "7/15/2016", 
"7/18/2016", "7/18/2016", "7/20/2016", "7/19/2016", "7/20/2016", 
"7/28/2016", "8/1/2016", "7/29/2016", "8/12/2016", "8/17/2016", 
"8/22/2016", "8/24/2016", "8/25/2016", "8/26/2016", "8/26/2016", 
"9/7/2016", "9/9/2016", "9/9/2016", "9/12/2016", "9/12/2016", 
"9/22/2016", "9/24/2016", "9/29/2016", "10/4/2016", "10/14/2016", 
"10/18/2016", "10/21/2016", "11/8/2016", "11/8/2016", "11/7/2016", 
"11/10/2016", "11/11/2016", "11/14/2016", "11/14/2016", "11/14/2016", 
"11/15/2016", "11/15/2016", "11/16/2016", "11/17/2016", "11/21/2016", 
"1/1/2001", "12/6/2016", "12/12/2016", "12/27/2016", "12/21/2016", 
"1/4/2017", "1/6/2017", "1/6/2017", "1/10/2017", "1/11/2017", 
"1/19/2017", "1/25/2017", "1/27/2017", "1/27/2017", "1/27/2017", 
"2/11/2017", "2/7/2017", "2/3/2017", "2/13/2017", "2/13/2017", 
"2/1/2017", "2/16/2017", "2/20/2017", "3/14/2017", "3/17/2017", 
"3/17/2017", "3/17/2017", "3/20/2017")), .Names = "Send Offer Letter", class = c("tbl_df", 
"tbl", "data.frame"), row.names = c(NA, -612L), spec = structure(list(
    cols = structure(list(`Send Offer Letter` = structure(list(), class = c("collector_character", 
    "collector"))), .Names = "Send Offer Letter"), default = structure(list(), class = c("collector_guess", 
    "collector"))), .Names = c("cols", "default"), class = "col_spec"))

目:

head(offerletter)
# A tibble: 6 × 1
  `Send Offer Letter`
                <chr>
1            1/1/2001
2            1/1/2001
3            1/1/2001
4            1/1/2001
5            1/1/2001
6            1/1/2001

我是通过csv导入的,它提供了以下警告:

offerletter <- read_csv("~/Hire Wars/New Employee Checklist.csv")
Parsed with column specification:
cols(
  `Send Offer Letter` = col_character()

当我尝试使用lubridate更改日期时:

offerletter <- mdy(offerletter)
Warning message:
All formats failed to parse. No formats found. 

当我尝试as.date时:

as.Date(offerletter, %m/%d/%Y)
Error: unexpected SPECIAL in "as.Date(offerletter, %m/%"

正如你所猜测的那样,我对R来说相对较新,而且我不理解为什么我会产生结果。

0 个答案:

没有答案