Description Usage Arguments Details Value Examples
lab_change
checks for changes in lab values
1 | lab_change(lab.data, change.by, FUN, back = 2)
|
lab.data |
A data frame with lab data |
change.by |
A numeric indicating the threshold for lab changes |
FUN |
A function for |
back |
An optional numeric specifying the number of days back to go. Defaults to 2 days. |
This function takes a data frame with lab data for a single lab and checks
whether the lab changes by a certain amount within a given period of time.
The parameters should include: change.by, the threshold which the lab must
change by; FUN, the function passed to rollapplyr
; back,
the time frame that the lab change must occur in. For FUN, use max when
looking for a decrease in lab value, and min when looking for an increase in
lab value.
A data frame
1 2 3 4 5 | ## Not run:
lab_change(data, -2, max, back = 2)
# checks for a >= 2 decrease in the lab value within the past 2 days
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.