cut_plot {MSG} | R Documentation |
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.
cut_plot(x, y, breaks, ..., pch.cut = 20)
x |
the x variable |
y |
the y variable |
breaks |
the breaks to cut the x variable |
... |
other arguments to be passed to
|
pch.cut |
the point symbol to denote the mean values of y |
Yihui Xie <https://yihui.org>
x = rnorm(100)
y = rnorm(100)
cut_plot(x, y, seq(min(x), max(x), length = 5))