mjs_point {metricsgraphics} | R Documentation |
metricsgraphics.js scatterplot "geom"
Description
This function adds a point/scatterplot "geom" to a metricsgraphics.js html widget.
Usage
mjs_point(mjs, point_size = 2.5, least_squares = FALSE,
size_accessor = NULL, color_accessor = NULL, color_type = "number",
color_range = c("blue", "red"), size_range = c(1, 5), x_rug = FALSE,
y_rug = FALSE)
Arguments
mjs |
metricsgraphics plot object |
point_size |
the radius of the dots in the scatterplot |
least_squares |
add a least squares line? (default: |
size_accessor |
bare or quoted name of a column to use to scale the size of the points |
color_accessor |
bare or quoted name of a column to use to scale the color of the points |
color_type |
specifies whether the color scale is quantitative or qualitative.
By setting this option to " |
color_range |
the range of colors, used to color different groups of points. |
size_range |
specifies the range of point sizes, when point sizes are mapped to data |
x_rug |
show a "rug" plot next to the x axis? (default: |
y_rug |
show a "rug" plot next to the y axis? (default: |
Value
metricsgraphics object
Examples
mtcars %>%
mjs_plot(x=wt, y=mpg, width=400, height=300) %>%
mjs_point(least_squares=TRUE)