Congratulations on your first post.
You're mistaken.
The format is what tells the function how to read the input characters.
Let's tell it the pattern of the delimiter.
The days of the week are in the way, so it is best to remove them.
x <- "1-6-2016"
as.Date(x, format = "%m-%d-%Y")
x <- "1_6_2016"
as.Date(x, format = "%m_%d_%Y")
x <- "6_2016-1"
as.Date(x, format = "%d_%Y-%m")
x <- "1/6/2016"
as.Date(x, format = "%m/%d/%Y")
I will teach you the dictionary rdocumentation.
https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/as.Date
Before asking questions, you should look for instructions and try running the sample code.
lubridate is a great package that further extends the recognition of the year and month.
library(lubridate)
x <- "1-6-2016"
mdy(x)
x <- "2016,Jan 6"
ymd(x)
Please continue to enjoy R.
If you have trouble with a function, use ? before the function.
?as.Date