medd: medd

Description Usage Arguments Value Examples

Description

converts the total dosages of various opioid medications and routes into a Morphine Equivalent Daily Dose (MEDD)

Usage

1
medd(x)

Arguments

x

data frame entanyl_iv IV fentaNYL total

Value

a data frame with the original columns, new morphine equivalent columns and the total morphine equivalent for each row

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
library(dplyr)
data <- data.frame(
  names=c("identity", "john", "jane", "jane"),
  pod=c(1,1,1,2),
  hydrocodone_po=c(1,5,1,1),
  morphine_iv=c(1,0,1,1),
  morphine_po=c(1,0,1,1),
  nalbuphine_iv=c(1,0,10,10),
  hydromorphone_iv = c(1,1,2,2),
  fentanyl_iv = c(1,2,2,0),
  fentanyl_td = c(1,1,1,1),
  hydromorphone_po = c(1,NA, 2, 2),
  methadone_iv = c(1,1,0,0),
  oxycodone_po = c(1,NA, 1, 1),
  oxymorphone_po = c(1,2,0,0),
  sufentanil_iv = c(1,2,0,0),
  tramadol_iv = c(1,1,NA,NA)
  )

meq <- meq_po
medd(data)

rparrish/medr documentation built on May 28, 2019, 12:35 a.m.