Skip to contents

Magic wrapper to automatically calculate the SOFA score on multiple intervals (eg. hours, days) assuming the data is exported based on Acutelines SOFA exports.

Usage

sofa_magic_wrapper(
  df,
  interval = 24,
  timespan = 72,
  return_df = FALSE,
  naming.cols = "SOFA_<interval>h_<variable>",
  naming.result = "SOFAscore_<interval>h_<variable>"
)

Arguments

df

dataframe containing all the data

interval

interval length, defaults to 24h

timespan

number of intervals*interval length, defaults to 72h

return_df

Return all elements of the sofa score in the DF instead of only totals

naming.cols

naming scheme to use to select columns. will be replaced by the interval and by the variable name

naming.result

naming scheme to assign to column with total score

Value

df with sofa scores

Details

This function assumes data is exported using the Acutelines SOFA export snippet, if not, manually define columns and use sofa_total().