PreviousResult {Transition} | R Documentation |
Find Previous Test Result for Subject
Description
get_prev_results()
identifies the previous test result for individual subjects and timepoints
in a longitudinal study.
add_prev_result()
interpolates these previous test results into a data frame for further analysis.
Usage
add_prev_result(
object,
subject = "subject",
timepoint = "timepoint",
result = "result"
)
get_prev_result(
object,
subject = "subject",
timepoint = "timepoint",
result = "result"
)
Arguments
object |
a |
subject |
|
timepoint |
|
result |
|
Details
See Transitions
details.
Value
add_prev_result() |
A |
get_prev_result() |
An |
See Also
data.frame
, Dates
, ordered factor
.
Other transitions:
PreviousDate
,
Transitions
,
uniques()
Examples
## Continuing example from `add_transitions()`
# subject, timepoint and result arguments all defaults and required types
Blackmore |> str()
# Previous test results as ordered factor
get_prev_result(Blackmore)
# Previous test result as column of data frame
(Blackmore <- add_prev_result(Blackmore)) |> head(32)
rm(Blackmore)