I am converting the variable column into date but only a specific format gets converted while for other I get NA. Is there a way to convert the entire column as date?
my code:
mydata<- mydata %>%
mutate(mydate=as.Date(variable, format = "%Y.%m.%d"))
mydata
Cat variable value mydate
A 5/1/23 0.593406085 <NA>
B 5/2/23 0.53820134 <NA>
C 5/3/23 0.501317568 <NA>
D 5/4/23 0.797812184 <NA>
E 5/5/23 0.444436445 <NA>
G 5/6/23 0.726510674 <NA>
H 5/7/23 0.764232936 <NA>
I 5/8/23 0.659018724 <NA>
J 5/9/23 0.669565494 <NA>
K 5/10/23 0.78342198 <NA>
L 5/11/23 0.437390481 <NA>
A 2023.05.03 0.752062817 5/3/23
B 2023.05.03 0.505276131 5/3/23
C 2023.05.03 0.338695417 5/3/23
D 2023.05.03 0.840394574 5/3/23
E 2023.05.03 0.56846352 5/3/23
G 2023.05.03 0.657647355 5/3/23
H 2023.05.03 0.052378105 5/3/23
I 2023.05.03 0.973788407 5/3/23
J 2023.05.03 0.658600196 5/3/23
K 2023.05.03 0.738847181 5/3/23
L 2023.05.03 0.361230414 5/3/23
A 2023.05.03 0.302676365 5/3/23
B 2023.05.03 0.196976833 5/3/23
C 2023.05.03 0.148042337 5/3/23
D 2023.05.03 0.931336165 5/3/23
E 2023.05.03 0.208053405 5/3/23
G 2023.05.03 0.292979982 5/3/23
H 2023.05.03 0.835556334 5/3/23
I 2023.05.03 0.691765386 5/3/23
J 2023.05.03 0.90168841 5/3/23
K 2023.05.03 0.713476267 5/3/23
L 2023.05.03 0.382385665 5/3/23