linfct_matrix_contrasts

linfct_matrix_contrasts(linfct, contrasts, p.message = FALSE)

Arguments

linfct

linear functions as created by linfct_from_model

p.message

print messages default FALSE

contrast

contrasts to determine linear functions for

Examples


m <- sim_make_model_lm( "factors")
#> creating sampleName from fileName column
#> completing cases
#> Joining with `by = join_by(protein_Id)`
Contr <- c("TreatmentA_vs_B" = "TreatmentA - TreatmentB",
    "BackgroundX_vs_Z" = "BackgroundX - BackgroundZ",
    "IntoflintoA" = "`TreatmentA:BackgroundX` - `TreatmentA:BackgroundZ`",
    "IntoflintoB" = "`TreatmentB:BackgroundX` - `TreatmentB:BackgroundZ`",
    "IntoflintoX" = "`TreatmentA:BackgroundX` - `TreatmentB:BackgroundX`",
    "IntoflintoZ" = "`TreatmentA:BackgroundZ` - `TreatmentB:BackgroundZ`",
    "interactXZ" = "IntoflintoX - IntoflintoZ",
    "interactAB" = "IntoflintoA - IntoflintoB"
     )
linfct <- linfct_from_model(m, as_list = FALSE)
x <- linfct_matrix_contrasts(linfct, Contr )
stopifnot(sum(x["interactXZ",]) == 0 )
stopifnot(sum(x["interactAB",]) == 0 )

m <- sim_make_model_lm( "interaction")
#> creating sampleName from fileName column
#> completing cases
#> Joining with `by = join_by(protein_Id)`
linfct <- linfct_from_model(m, as_list = FALSE)
x <- linfct_matrix_contrasts(linfct, Contr )
stopifnot(sum(x["interactXZ",]) ==1 )
stopifnot(sum(x["interactAB",]) ==1 )