Learn R Programming

remode (version 0.1.0)

plot.remode_result: Plot for remode_result

Description

The `plot.remode_result` function provides a way to visualize the output of the `remode` function using a bar plot, highlighting the identified modes by adjusting the bar density.

Usage

# S3 method for remode_result
plot(
  x,
  main = paste("Number of modes =", x$nr_of_modes),
  density = replace(rep(20, length(x$frequency_input_data)), x$mode_indeces, 50),
  ...
)

Value

None. This function is called for its side effects.

Arguments

x

A list of class `remode_result` containing the output of the `remode` function.

main

A character string specifying the main title of the plot. Default is "Modes = (number of modes)".

density

A numeric vector specifying the density of shading lines, in lines per inch, for the bars. Default is 20 for non-mode bars and 50 for mode bars.

...

Additional arguments passed to the `barplot` function.

Examples

Run this code
data <- c(80, 90, 110, 70, 90)
result <- remode(data)
plot(result, xlab="This is my x-axis label", col="red", names=-2:2)

Run the code above in your browser using DataLab