column_chart_normalized {tidycharts}R Documentation

Generate column chart with normalization.

Description

Every column will be rescaled, so columns have the same height.

Usage

column_chart_normalized(
  data,
  x,
  series = NULL,
  series_labels = series,
  interval = "months"
)

Arguments

data

data frame in wide format containing data to be plotted

x

vector containing labels for x axis or name of column in data with values of x axis labels

series

vector containing names of columns in data with values to plot

series_labels

optional vector with labels for series to be plotted as legend. The default is the same as series.

interval

intervals on x axis. The width of the bars depends on this parameter

Value

object of class tidychart with a character vector containing SVG elements

Examples

# prepare some data frame
df <- data.frame(x = month.abb[1:6],
                 y = c(2, 4, 2, 1, 2.5, 3),
                 z = c(3, 4.5, 2, 1, 4, 2))

# generate character vector with svg data
column_chart_normalized(df, x = df$x, series = c('y', 'z'))


[Package tidycharts version 0.1.3 Index]