R - Help in Converting factor to date (%m/%d/%Y %H:%M)

前端 未结 4 1133
南旧
南旧 2021-01-23 20:57

I am importing a data frame into R, but R is not recognizing the columns with the dates as being in dates format.

> mydata[1,1] [1] 1/1/2003 0:00 216332 Levels:

4条回答
  •  闹比i
    闹比i (楼主)
    2021-01-23 21:23

    If you are using read.table, read.csv or similar functions to read in the data then you could look at this solution for a way to specify which columns will be dates and have them automatically converted as they are read in. This will do the conversion on the character strings without any conversion to factor (which may be part of your problem).

提交回复
热议问题