Learn R Programming

designr (version 0.1.11)

random.factors: Extract factors by type

Description

From a given design, extract contained random or fixed factors as a list.

Usage

random.factors(design, include_interactions = TRUE)

fixed.factors(design)

Arguments

design

The factor design to check.

include_interactions

Should random factor interactions be included?

Value

A list of factors that are either fixed or random.

Functions

  • random.factors: Return fixed factors

Examples

Run this code
# NOT RUN {
des <- fixed.factor("Factor1", c("1A","1B")) +
       fixed.factor("Factor2", c("2A","2B")) +
       random.factor("Subject", c("Factor1"))
       
random.factors(des)
fixed.factors(des)

stopifnot(setequal(names(random.factors(des)), c("Subject")))
stopifnot(setequal(names(fixed.factors(des)), c("Factor1","Factor2")))


# }

Run the code above in your browser using DataLab