I have a dataset the contains a large number of columns every column has a name of date in the form of x2019.10.10
what I want is to remove the x letter and change the type of the date to be 2019-10-10
How this could be done in the R environment?
I have a dataset the contains a large number of columns every column has a name of date in the form of x2019.10.10
what I want is to remove the x letter and change the type of the date to be 2019-10-10
How this could be done in the R environment?
One solution would be:
x
.
with-
.Here I create a
dataframe
that has similar columns to yours:And then, using
dplyr
(looks much tidier):If you do not want to use
dplyr
, here is how you would do the same thing inbase R
: