Learn R Programming

billboarder (version 0.5.2)

bb_radarchart: Helper for creating a radar chart

Description

Helper for creating a radar chart

Usage

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

Value

A `billboard` `htmlwidget` object.

Arguments

bb

A `billboard` `htmlwidget` object.

data

A `data.frame`, the first column will be used for x axis unless specified otherwise in `mapping`. If not a `data.frame`, an object coercible to `data.frame`.

mapping

Mapping of variables on the chart, see [bbaes()].

...

Arguments passed to [bb_radar()].

Examples

Run this code
library("billboarder")

# data about Avengers
data("avengers_wide")

# if not specified, first column is used as x-axis,
# all others are used on y-axis
billboarder() %>%
  bb_radarchart(data = avengers_wide)

# specify explicitly which column to use with mapping
billboarder() %>%
  bb_radarchart(
    data = avengers_wide,
    mapping = bbaes(x = axis, y = `Captain America`)
  )

# with data in "long" format you can use "group" aesthetics
data("avengers")
billboarder() %>%
  bb_radarchart(
    data = avengers,
    mapping = bbaes(x = axis, y = value, group = group)
  )

Run the code above in your browser using DataLab