lc_hist: Histograms and density plots

Description Usage Arguments Functions Available properties Examples

View source: R/lc.R

Description

These functions make either a histogram or a density plot of the given data and either add them as a new layer to an existing chart or create a new chart.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
lc_hist(
  data = list(),
  place = NULL,
  ...,
  chartId = NULL,
  layerId = NULL,
  with = NULL,
  addLayer = FALSE
)

lc_dens(
  data = list(),
  place = NULL,
  ...,
  chartId = NULL,
  layerId = NULL,
  with = NULL,
  addLayer = FALSE
)

Arguments

data

Name-value pairs of properties passed through the dat function. These properties will be re-evaluated on each updateCharts call.

place

An ID of the container, where to place new chart. It will be ignored if the chart already exists. If not defined, the chart will be appended to the web page's body.

...

Name-value pairs of properties that will be evaluated only once and then will remain constant. These properties can still be changed later using the setProperties function.

chartId

An ID for the chart. All charts must have unique IDs. If a chart with the same ID already exists, it will be replaced unless addLayer = TRUE. If ID is not defined, it will be the same as the value of the place argument. And if both are not defined, the ID will be set to ChartN, where N - 1 is the number of existing charts.

layerId

An ID for the new layer. All layers within one chart must have different IDs. If a layer with the same ID already exists, it will be replaced. If not defined, it will be set to LayerN, where N - 1 is the current number of layers in this chart.

with

A dataset or a list from which other properties should be taken. If the dataset doesn't have a column with the requested name, the variable will be searched for outside of the dataset. It must be a data.frame or a list.

addLayer

If there is already a chart with the same ID, this argument defines whether to replace it or to add a new layer to it. This argument is ignored if both place and chartId are NULL or if there is no chart with the given ID.

Functions

Available properties

You can read more about different properties here.

These functions are extensions of lc_line (lc_dens) or lc_bars (lc_hist) and therefore also accept all their properties.

Examples

1
2
lc_hist(dat(value = rnorm(1000), nbins = 30, height = 300))
lc_dens(dat(value = rnorm(1000), height = 300)) 

rlc documentation built on Jan. 5, 2022, 1:11 a.m.

Related to lc_hist in rlc...