facet_chart: Facet chart.

Description Usage Arguments Value Examples

View source: R/join_charts.R

Description

Create multiple charts with data split into groups.

Usage

1
facet_chart(data, facet_by, ncols = 3, FUN, ...)

Arguments

data

data frame in wide format containing data to be plotted

facet_by

a name of column in data, that the charts will be splitted by

ncols

number of columns of the plots. Number of rows will be adjusted accordingly

FUN

function to plot the basic chart

...

other parameters passed to FUN

Value

object of class tidychart with a character vector containing SVG elements

Examples

1
2
3
4
5
6
7
8
9
facet_chart(
  data = mtcars,
  facet_by = 'cyl',
  ncols = 2,
  FUN = scatter_plot,
  x = mtcars$hp,
  y = mtcars$qsec,
  legend_title = ''
 )

tidycharts documentation built on Jan. 18, 2022, 5:07 p.m.