I have a R data frame like bellow,
Time value
00:00:00 1
00:00:03 3
00:00:06 2
00:00:09 1
When I check the classes of fields in dataframe, i found that,
Time value
"factor" "integer"
Then I try to convert Time's data type into time using bellow code.
df["Time"] <- as.POSIXct(df["Time"],format="%H:%M:%S")
When I execute above code below error was generated.
Error in as.POSIXct.default(df["Time"], format = "%H:%M:%S") : do not know how to convert 'df["Time"]' to class “POSIXct”
My questions are, why is this error occurred and how I can over come this?