[,mediation_data,ANY,ANY,ANY-method | R Documentation |
We can subset samples by indexing into a mediation dataset. It will subsample all fields – pretreatments, treatments, mediators, and outcomes. Note that there is no way to subset columns in this way, since they would be different across each source.
## S4 method for signature 'mediation_data,ANY,ANY,ANY'
x[i, j, ..., drop = TRUE]
x |
An object of class |
i |
An integer or integer/logical vector specifying the samples to subset to. |
j |
A placeholder to argree with R's |
... |
A placeholder to agree with R's |
drop |
A placeholder to agree with R's |
A version of the input mediation_data object whose @mediators,
@outcomes, @treatments, and @pretreatments rows have all been subsetted
according to i
.
exper <- demo_joy() |>
mediation_data("PHQ", "treatment", starts_with("ASV"))
exper[1]
exper[1:10]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.