util_histogram {dataquieR}R Documentation

Utility function to create histograms

Description

A helper function for simple histograms.

Usage

util_histogram(
  plot_data,
  num_var = colnames(plot_data)[1],
  fill_var = NULL,
  facet_var = NULL,
  nbins_max = 100,
  colors = "#2166AC",
  is_datetime = FALSE
)

Arguments

plot_data

a data.frame without missing values

num_var

column name of the numerical or datetime variable in plot_data (if omitted, the first column is assumed to contain this variable)

fill_var

column name of the categorical variable in plot_data which will be used for coloring stacked histograms

facet_var

column name of the categorical variable in plot_data which will be used to create facets

nbins_max

the maximum number of bins for the histogram (see util_optimize_histogram_bins)

colors

vector of colors, or a single color

is_datetime

if TRUE, the x-axis will be adapted for the datetime format

Value

a histogram


[Package dataquieR version 2.5.1 Index]