show_me_how_drunk: Visualization of hypothetical blood-alcohol-level over time

Description Usage Arguments Value Author(s) Examples

View source: R/promillo-withdoc.R

Description

Uses the function tell_me_how_drunk() to compute the blood-alcohol-level after the drinking period and displays some intermediate values according to a chosen interval width. Note that the visualization is simplified according to the assumption that every drink was consumed right at the start of the drinking period. An actual realistic curve would be fluctuating

Usage

1
2
3
4
5
6
7
8
9
show_me_how_drunk(
  age,
  sex = c("male", "female"),
  height,
  weight,
  drinking_time,
  drinks,
  interval_width = as.difftime("00:05:00")
)

Arguments

age

age of the individual in years

sex

sex of the individual. Either "male" or "female"

height

height of the individual in centimeters

weight

weight of the individual in kilograms

drinking_time

two element POSIXct-vector with the first element being the start time of drinking and the second element being the end time of drinking

drinks

named numeric vector. Names of the vector represent the consumed type of drink, the numbers represent the consumed quantitiy of the corresponding drink. Currently the following drinks are supported: "massn", "hoibe", "wein" and "schnaps"

interval_width

difftime-object, representing the time-interval-width for intermediate values of blood-alcohol-level. If it is chosen too wide, only the start and end value are displayed. Default is 5 minutes

Value

a ggplot-object generated by ggplot2::qplot()

Author(s)

Marc Johler

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
show_me_how_drunk(
  age = 39,
  sex = "male",
  height = 190,
  weight = 87,
  drinking_time = as.POSIXct(c("2016-10-03 17:15:00", "2016-10-03 22:55:00")),
  drinks = c("massn" = 3, "schnaps" = 4),
  interval_width = as.difftime("00:10:00")
)

## End(Not run)

fort-w2021/promillo-ex-MarcJohler documentation built on Feb. 8, 2021, 6:30 a.m.