I am merging two datasets and need to standardize how the dates appear. From searching another forum I was able to figure out how to remove a leading zero using this
Use "%Y" rather than "%y": %y is for a 2-digit year, so it only keeps the 20 in 2010 and interprets it as 2020.
That approach can work. IMO the easiest is to do this in two steps: first use str_remove to remove the leading zero, then use str_replace to remove any zero following /. There are other ways to do it which may be more efficient (in execution speed), but I find them harder to read.
Just a thought - before merging both datasets, why don't you transform the dates in both sets to a compatible date format, e.g. by using the lubridate package. And only merge in a second step. (Instead of trying to modify one dataset to be in line with the other dataset).