Skip to content

Commit

Permalink
add extra timecourse examples
Browse files Browse the repository at this point in the history
  • Loading branch information
craddm committed Oct 20, 2023
1 parent 9015a12 commit 283404e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
13 changes: 10 additions & 3 deletions R/plot_timecourse.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
#' @examples
#' library(ggplot2)
#' plot_timecourse(demo_epochs, "A29")
#' plot_timecourse(demo_epochs, "A29", add_CI = TRUE)
#' plot_timecourse(demo_spatial, "Oz", mapping = aes(colour = epoch_labels))
#' plot_timecourse(demo_spatial, "Oz", facets = ~epoch_labels)
#' plot_timecourse(demo_epochs, "A29", baseline = c(-.1, 0))
#' plot_timecourse(demo_epochs, "A29", baseline = c(-.1, 0), add_CI = TRUE)
#' plot_timecourse(demo_spatial, "Oz", baseline = c(-.1, 0), mapping = aes(colour = epoch_labels))
#' plot_timecourse(demo_spatial, "Oz", baseline = c(-.1, 0), facets = ~epoch_labels)
#'@param data EEG dataset. Should have multiple timepoints.
#'@param ... Other arguments passed to methods.
#'@import ggplot2
Expand Down Expand Up @@ -493,6 +494,12 @@ create_tc <- function(data,
}

if (add_CI) {
if (!requireNamespace("Hmisc", quietly = TRUE)) {
stop(
"Package \"Hmisc\" must be installed to add confidence intervals.",
call. = FALSE
)
}
if (is.null(mapping)) {
if (is.null(colour)) {
tc_plot <- tc_plot +
Expand Down
7 changes: 4 additions & 3 deletions man/plot_timecourse.Rd

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

0 comments on commit 283404e

Please sign in to comment.