I have some date/times in a variable where I would only like to extract the year.
Here is an example:
2/14/21 4:55
I would only like to extract '2021' from this.
By the way, the class
for this variable is 'character'.
> class(df$DTS)
[1] "character"