You could try
options(digits.secs=6)
times <- strptime(times,"%Y.%m.%d %H.%M.%OS", tz= " ")
#> times
# [1] "2015-07-06 13:41:00.033" "2015-07-06 13:40:00.033" "2015-07-06 13:39:00.033" "2015-07-06 13:38:00.033" "2015-07-06 13:37:00.007"
# [6] "2015-07-06 13:36:00.007" "2015-07-06 13:35:00.007" "2015-07-06 13:34:00.007" "2015-07-06 13:33:00.007" "2015-07-06 13:32:00.007"
#[11] "2015-07-06 13:31:00.007" "2015-07-06 13:30:00.007" "2015-07-06 13:29:00.007" "2015-07-06 13:28:00.007" "2015-07-06 13:27:00.007"
#[16] "2015-07-06 13:26:00.007" "2015-07-06 13:25:00.007" "2015-07-06 13:24:00.007" "2015-07-06 13:23:00.007"
#> class(times)
#[1] "POSIXlt" "POSIXt"
data
times <-c("2015.07.06 13.41.00.033", "2015.07.06 13.40.00.033", "2015.07.06 13.39.00.033",
"2015.07.06 13.38.00.033", "2015.07.06 13.37.00.007", "2015.07.06 13.36.00.007",
"2015.07.06 13.35.00.007", "2015.07.06 13.34.00.007", "2015.07.06 13.33.00.007",
"2015.07.06 13.32.00.007", "2015.07.06 13.31.00.007" ,"2015.07.06 13.30.00.007",
"2015.07.06 13.29.00.007", "2015.07.06 13.28.00.007", "2015.07.06 13.27.00.007",
"2015.07.06 13.26.00.007", "2015.07.06 13.25.00.007", "2015.07.06 13.24.00.007",
"2015.07.06 13.23.00.007")
If you want to use these POSIXt entries for a time series of your data, a convenient way could consist in converting the dataframe into an xts
object.
This could be achieved, e.g., with
library(xts)
my_xts <- xts(times, data)
where data
are the observations, stored as numerical values, that correspond to the above sequence of points in time.
Hope this helps.