I am using R. I am including time as a co-variate in my model.

10:30, 11:56, 12:00 etc

Is there a way to tell R that my values are time measurements?

1 Answer 1


This is not really a question for GIS.SE but I would recommend to use strptime().

var <- strptime("10:30", "%H:%M")

You can return the value as time:

format(var, "%H:%M")
# [1] "10:30"

For further question just regarding R I would recommend stackexchange.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.