Learn R Programming

visachartR (version 3.3.0)

scatter_plot: scatter_plot

Description

R wrapper for @visa/scatter-plot via htmlwidgets.

Here is an example of scatter-plot in action:

example scatter plot

Usage

scatter_plot(
  data,
  xAccessor,
  yAccessor,
  groupAccessor = "",
  mainTitle = "",
  subTitle = "",
  accessibility = list(),
  props = list(),
  ...
)

Value

a visaChart htmlwidget object for plotting a scatter plot

Arguments

data

required to be a valid, R data frame. Data used to create chart, an array of objects which includes keys that map to chart accessors.

xAccessor

String. Key used to determine each point's position along the x-axis.

yAccessor

String. Key used to determine each point's position along the y-axis.

groupAccessor

String. Key used to determine bar group encoding (e.g., color/texture).

mainTitle

String. The dynamic tag of title for the map (or you can create your own separately). See highestHeadingLevel prop for how tags get assigned.

subTitle

String. The dynamic tag for a sub title for the map (or you can create your own separately). See highestHeadingLevel prop for how tags get assigned.

accessibility

List(). Manages messages and settings for chart accessibility, see object definition

props

List(). A valid R list with additional property configurations, see all props for @visa/scatter-plot

...

All other props passed into the function will be passed through to the chart, see all props for @visa/scatter-plot.

Details

To see all available options for the chart properties/API see @visa/scatter-plot.

Examples

Run this code
library(dplyr)
scatter_plot(mtcars[order(mtcars$cyl),], "wt", "mpg", "cyl")

Run the code above in your browser using DataLab