library(lubridate)
#>
#> Attaching package: 'lubridate'
#> The following objects are masked from 'package:base':
#>
#> date, intersect, setdiff, union
the_string <- "2022-10-12"
ymd(the_string) |> str()
#> Date[1:1], format: "2022-10-12"
Created on 2022-10-12 with reprex v2.0.2
