Every time I try to convert a factor to a date in a DataFrame (data) it returns "NA" in the factor values, in the example I show str (data) it returns that the DATE field is a factor.
data$DATE <- as.Date(data$DATE,format="%Y/%m/%d %H")
DATE OBJ No
2018-09-24-00 Leo 12
2018-09-24-00 Jhon 12
2018-09-24-02 Ale 13
2018-09-24-00 Juan 13
2018-09-24-04 Duas 13
2018-09-24-05 Doi 76
2018-09-24-06 Doi 78
2018-09-24-07 Doi 80
2018-09-24-08 Doi 82
2018-09-24-09 Doi 84
2018-09-24-00 Doi 86
2018-09-24-11 Doi 88
2018-09-24-12 Doi 90
2018-09-24-13 Doi 92
2018-09-24-14 Doi 94
2018-09-24-15 Doi 96
2018-09-24-16 Doi 98
2018-09-24-17 Doi 100
2018-09-24-18 Doi 102
2018-09-24-19 Doi 104
And he returns me
DATE OBJ No
NA Leo 12
NA Jhon 12
NA Ale 13
NA Juan 13
NA Duas 13
NA Doi 76
NA Doi 78
NA Doi 80
NA Doi 82
NA Doi 84
NA Doi 86
NA Doi 88
NA Doi 90
NA Doi 92
NA Doi 94
NA Doi 96
NA Doi 98
NA Doi 100
NA Doi 102
NA Doi 104
This is what I need to shoot in the DataFrame for the hours of the day
data <- filter(data ,hour(Date) == 0)
And give me back
DATE OBJ No
2018-09-24-00 Leo 12
2018-09-24-00 Jhon 12
2018-09-24-00 Juan 13
If you can help me to cast this column DATE to full date