I have a text file that I import into R with read.files:
DataFolder <- "unzipped"
LakeNames <- "Location1"
extension <- "txt"
# -- import data
data <- read.table(paste(DataFolder, LakeNames, paste(LakeNames, ".", extension, sep=""), sep="\\"),
header = TRUE, sep = "\t")
This reads in the data as
> head(data)
dateTime dat
1 2009-03-01 00:00 0
2 2009-03-01 01:00 0
3 2009-03-01 02:00 0
4 2009-03-01 03:00 0
5 2009-03-01 04:00 0
6 2009-03-01 05:00 0
where
> class(data$dateTime)
[1] "factor"
when I try to convert the dateTime into POSIXct
> data$dateTime <- as.POSIXct(data$dateTime)
> head(data)
dateTime dat
1 2009-03-01 0
2 2009-03-01 0
3 2009-03-01 0
4 2009-03-01 0
5 2009-03-01 0
6 2009-03-01 0
Why is this not showing the HH:MM part of the dateTime when I convert to POSIXct?