| plot.HRM | R Documentation |
Plotting profile curves for up to one whole- or subplot-factor
## S3 method for class 'HRM'
plot(x, xlab = "time", ylab = "mean", legend = TRUE, legend.title = "", ...)
x |
An object of class 'HRM' from the function 'hrm_test' |
xlab |
label of the x-axis of the plot |
ylab |
label of the y-axis of the plot |
legend |
logical indicating if a legend should be plotted |
legend.title |
title of the legend |
... |
Further arguments passed to the 'plot' function |
An object of class 'ggplot' containing the profile plot of the group means, which can be printed or further modified with 'ggplot2' functions.
data(EEG)
head(EEG)
# plots profiles according to groups with
# subplot-factor called dimension
# first create an HRM object
object_hrm <- hrm_test(value ~ group*dimension, subject = "subject", data = EEG)
# plot the HRM object, here we use the additional argument 'theme_bw()' for ggplot2
plot(object_hrm, legend = TRUE, legend.title = "Group", ... = ggplot2::theme_bw() )
# same plot without a legend
# note that 'theme_bw' overwrites the standard legend properties of plot.HRM
plot(object_hrm, ... = ggplot2::theme_bw() +
ggplot2::theme(legend.title = ggplot2::element_blank(), legend.position="none") )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.