mjs_point: metricsgraphics.js scatterplot "geom"

Description Usage Arguments Value Examples

Description

This function adds a point/scatterplot "geom" to a metricsgraphics.js html widget.

Usage

1
2
3
4
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: FALSE - no)

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 "category", you can color the points according to some other discrete value

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: FALSE - no)

y_rug

show a "rug" plot next to the y axis? (default: FALSE - no)

Value

metricsgraphics object

Examples

1
2
3
mtcars %>%
 mjs_plot(x=wt, y=mpg, width=400, height=300) %>%
 mjs_point(least_squares=TRUE)

metricsgraphics documentation built on May 1, 2019, 8:07 p.m.