Description Usage Arguments Details
View source: R/internal_time_difference.R
Many measures need to work on the difference between two date/times.
1 | internal_time_difference(start_field, end_field, units = "mins")
|
start_field |
The field at the beginning of the time interval. |
end_field |
The field at the end of the time interval. |
units |
This is a string which must match those in the difftime function (ie. 'minutes', 'hours', 'days' etc) |
This function calculates the difference between those times, or returns an NA. The returned value is an integer, which makes calculations simple.
Always calculate to the lowest precision you want to report - so if you want to report hours and minutes then ask for the time in minutes and convert the value later at the printing stage to be in hours and minutes.
Many measures needing this should ideally have this value stored in the source data ultimately, so should be recorded for potential review of database inputs at a later stage.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.