Converting time variable to numeric

Hi, I have calculated the difference in hours between time of blood draw and baseline of 07:00. My variable of interest is called hourDiff and is formatted as a time variable. I am using "lubridate". How can I convert this "hourDiff" variable to numeric? When I plot the distribution of hours since baseline, the x-axis shows the time stamps, and they are not time stamps but accumulated hours since baseline.

Thanks!
Jonelle

Can you please share a small part of the data set in a copy-paste friendly format?

In case you don't know how to do it, there are many options, which include:

  1. If you have stored the data set in some R object, dput function is very handy.

  2. In case the data set is in a spreadsheet, check out the datapasta package. Take a look at this link.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.