I have a dataframe like this:Col1   Col2                  Col3  1   1998-09-02               A  2   2011-10-29               B  3   2000-12-24               C  4   2008-09-12               D  5   2004-07-09               E  6   2013-01-31               FAnd I want to make Col2 into year instead of the exact dates, something like:Col1     Col2             Col3  1       1998              A  2       2011              B  3       2000              C  4       2008              D  5       2004              E  6       2013              FAt the same time, I want the strings in Col2 be integers so that I can subset my dataframe for later programming.How should I do that?
Remove part of a string in a dataframe column in R
r;dataframe