Skip to content

Commit

Permalink
Add example design
Browse files Browse the repository at this point in the history
  • Loading branch information
csoneson committed May 11, 2020
1 parent 6726be5 commit 77f730d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ExploreModelMatrix
Type: Package
Title: Graphical Exploration of Design Matrices
Version: 1.1.1
Version: 1.1.2
Authors@R: c(person("Charlotte", "Soneson", role = c("aut", "cre"),
email = "[email protected]",
comment = c(ORCID = "0000-0003-3833-2169")),
Expand Down
12 changes: 11 additions & 1 deletion R/ExampleDesigns.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#' @param exampleID The name of the example design. One of "One factor, unpaired
#' samples", "One factor, paired samples", "Two crossed factors", "Two
#' crossed, one blocking factor", "Two crossed, one nested factor", "Two
#' crossed, one nested factor, dummy coded"
#' crossed, one nested factor, dummy coded", "Two crossed, one nested factor
#' (manuscript example)"
#'
#' @author Charlotte Soneson
#'
Expand Down Expand Up @@ -57,6 +58,15 @@
rep(c("A", "B", "C"), each = 6))
)
design <- "~ diagnosis + diagnosis:dummy + diagnosis:treatment"
} else if (exampleID == "Two crossed, one nested factor (manuscript example)") {
sampledata <- data.frame(
subject = paste0("S", rep(1:6, each = 2)),
count = factor(rep(c("ref", "alt"), 6), levels = c("ref", "alt")),
condition = rep(c("control", "treated"), each = 6),
subjectdummy = rep(paste0("D", rep(1:3, each = 2)), 2),
stringsAsFactors = FALSE
)
design <- "~condition + condition:subjectdummy + condition:count"
} else {
stop("Unidentified example ID")
}
Expand Down
3 changes: 2 additions & 1 deletion R/ExploreModelMatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@ ExploreModelMatrix <- function(sampleData = NULL, designFormula = NULL) {
"Two crossed factors",
"Two crossed, one blocking factor",
"Two crossed, one nested factor",
"Two crossed, one nested factor, dummy coded"),
"Two crossed, one nested factor, dummy coded",
"Two crossed, one nested factor (manuscript example)"),
selectize = TRUE, multiple = FALSE
)
})
Expand Down
3 changes: 2 additions & 1 deletion man/INTERNAL_.ExampleDesigns.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 77f730d

Please sign in to comment.