Learn R Programming

billboarder (version 0.2.4)

bb_scatterplot: Helper for creating a scatter chart

Description

Helper for creating a scatter chart

Usage

bb_scatterplot(bb, data, mapping = NULL, ...)

Arguments

bb

A billboard htmlwidget object.

data

A data.frame

mapping

Mapping of variables on the chart, see bbaes.

...

unused

Value

A billboard htmlwidget object.

Examples

Run this code
# NOT RUN {
# Use first and second variable by default
billboarder() %>% 
  bb_scatterplot(data = iris)


# Explicit mapping
billboarder() %>% 
  bb_scatterplot(
    data = iris, 
    mapping = bbaes(Petal.Length, Petal.Width)
  ) %>% 
  bb_x_axis(tick = list(fit = FALSE))


# Grouping variable
billboarder() %>% 
  bb_scatterplot(
    data = iris, 
    mapping = bbaes(Sepal.Length, Sepal.Width, group = Species)
  )
  
# Size variable
billboarder() %>% 
  bb_scatterplot(
    data = iris, 
    mapping = bbaes(Sepal.Length, Sepal.Width,
                    group = Species, size = Petal.Width),
    range = c(0.5, 120)
  ) %>% 
  bb_x_axis(tick = list(fit = FALSE))

# }

Run the code above in your browser using DataLab