calc_time_between: Time Between Function

View source: R/calc_time_between.R

calc_time_betweenR Documentation

Time Between Function

Description

Finds the difference between two timestamps.

Usage

calc_time_between(
  dataset,
  begining_time,
  end_time,
  new_name = "time_diff",
  unitx = "days"
)

Arguments

dataset

The dataset you are working with.

begining_time

POSIXct variable that denotes the start of the time interval.

end_time

POSIXct variable that that denotes the end of the time interval.

new_name

Character variable that indicates what you want to the time difference variable to be called.

unitx

Character variable that indicates what units to return time difference, default is days.

Value

Gives a dataset with a new column consisting of the difference between two time periods

Examples

## Not run: 
data <- data %>% calc_time_between(culture_start, culture_end, unitx = "days")
data <- calc_time_between(data, lactate_start, lactate_end, unitx = "hours")

## End(Not run)

trentgillin/SepsisR documentation built on Nov. 26, 2022, 12:41 p.m.