我有一个数据框,其中一列的数据目前是"字符",我需要将它更改为"日期",但是日期格式混合在一起,所以不能只使用as.Date()。此外,该列中还有空行。以下是数据样例:
> head(FarmersMkt$StartDate,n = 50)
[1] "June " "January " "05/01/2013 " "July " "06/17/2013 " "05/04/2013 " "" "06/27/2013 "
[9] "June " "" "06/29/2013 " "06/06/2013 " "" "May " "" ""
[17] "05/11/2013 " "01/01/2013 " "" "June " "June " "06/06/2013 " "" ""
[25] "" "04/20/2013 " "" "" "05/11/2013 " "" "01/01/2013 " "01/01/2013 "
[33] "06/06/2013 " "May " "06/23/2013 " "01/01/2013 " "June 17, 2012 " "June " "" ""
[41] "06/06/2013 " "" "May " "" "" "" "04/20/2013 " "01/01/2013 "
[49] "07/13/2013 " ""
所有人的年份应为2013年,日期可以是虚假数据。我如何将该列中的数据转换为日期格式?