I am trying to change a txt column that has a date in the format %m/%d/%Y to a date but the problem is that I cannot use its name because its not known (I am doing an app so the name can vary), one thing that I am sure is that is the column number 1 of the dataframe.
using the name of the column the R code would be
dates <- as.Date(data$date, "%m/%d/%Y")
But I cant do this, I need to use the index so I tried this
dates <- as.Date(data[1], "%m/%d/%Y")
But I get this error
Error in as.Date.default(data[1], "%m/%d/%Y") :
do not know how to convert 'data[1]' to class “Date”
thanks for the help