cut_plot {MSG}R Documentation

Cut the points in a scatter plot into groups according to x-axis

Description

This function can categorize the variable on the x-axis into groups and plot the mean values of y. The purpose is to show the arbitrariness of the discretization of data.

Usage

cut_plot(x, y, breaks, ..., pch.cut = 20)

Arguments

x

the x variable

y

the y variable

breaks

the breaks to cut the x variable

...

other arguments to be passed to plot.default

pch.cut

the point symbol to denote the mean values of y

Author(s)

Yihui Xie <https://yihui.org>

Examples

x = rnorm(100)
y = rnorm(100)
cut_plot(x, y, seq(min(x), max(x), length = 5))

[Package MSG version 0.8 Index]