Learn R Programming

ARPobservation (version 1.2.2)

plot.behavior_stream: Plot method for behavior_stream objects

Description

Creates a graphical representation of a set of simulated behavior streams.

Usage

# S3 method for behavior_stream
plot(
  x,
  session_color = "black",
  episode_color = "blue",
  episode_thickness = 2,
  ...
)

Value

An object of class ggplot.

Arguments

x

object of class behavior_stream

session_color

character string indicating the color of the lines that represent session time. Default is black.

episode_color

character string indicating the color of the bars that represent episode durations. Default is blue.

episode_thickness

numeric value indicating the thickness of the bars that represent episode durations. Default is 2.

...

Further arguments, not used for this method.

Details

The plot is created using ggplot from the ggplot2 package, which must be installed.

Examples

Run this code

if (requireNamespace("ggplot2", quietly = TRUE)) {
b_streams <- r_behavior_stream(n = 5, mu = 3, lambda = 10, 
                               F_event = F_exp(), F_interim = F_exp(), 
                               stream_length = 100)
plot(b_streams)
}

Run the code above in your browser using DataLab