Create multiple charts with data split into groups.

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

facet_chart( data = mtcars, facet_by = 'cyl', ncols = 2, FUN = scatter_plot, x = mtcars$hp, y = mtcars$qsec, legend_title = '' )