I am attempting to change values in my data set to Dates, however I get the error code form y code;
>WC1$date <- as.Date(WC1[X,], format= "%m/%d/%Y")
Error in as.Date(WC1[X, ], format = "%m/%d/%Y") : object 'X' not found
Error in WC1["X", ] : subscript out of bounds
Currently this is what my data looks like.
X X1.2.2018 X1.3.2018 X1.4.2018 X1.5.2018 X1.8.2018
[1,] "ED" NA NA NA NA NA
[2,] "Front Clinic " NA NA NA NA NA
Even if I transpose my data and attempt with a similar approach. In the CSV file my data does not have X's in front of the dates so I'm not sure as to why they appear that way in R. Also I have tried using date format and get the same error.
> WC1$date <- as.Date(WC1['X',], format= "%m.%d.%Y")
Error in WC1["X", ] : subscript out of bounds