Learn R Programming

HRM (version 1.2.1)

hrm.plot: Plots profiles of the groups in case of one whole- and one subplot-factor.

Description

Plots profiles of the groups in case of one whole- and one subplot-factor.

Usage

hrm.plot(
  data,
  group,
  factor1,
  subject,
  response,
  xlab = "time",
  ylab = "mean",
  legend = TRUE,
  legend.title = NULL
)

Arguments

data

A data.frame containing the data

group

column name within the data frame data specifying the groups

factor1

column name within the data frame data specifying the first subplot-factor

subject

column name within the data frame X identifying the subjects

response

column name within the data frame X containing the response variable

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

Value

Plots profiles of the groups.

Examples

Run this code
# NOT RUN {
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", ... =  theme_bw() )

# same plot without a legend
# note that 'theme_bw' overwrites the standard legend properties of plot.HRM
plot(object_hrm, ... =  theme_bw() +
  theme(legend.title = element_blank(), legend.position="none") )
# }

Run the code above in your browser using DataLab