Convert dates with different formats in data frame over multiple columns
问题 I have data frame (test) that looks like this: abx start stop abx2 start2 stop2 abx3 start3 stop3 cipro 07/10/12 07/10/12 flagyl 07/10/12 07/17/12 n/a n/a n/a vanco 07/12/2012 07/15/2012 levo 07/20/2012 07/27/2012 n/a n/a n/a This continues until start9/stop9. I'd like to convert all the dates to standard date format. I wrote a function to convert the start dates depending on the number of characters in the date. Plan to write a similar function for the stops. dateconv <- function(x) { as