lc_hist {rlc} | R Documentation |
Histograms and density plots
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
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 |
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 |
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 |
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 |
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 |
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 |
Functions
-
lc_hist()
: makes a histogram. It is an extension oflc_bars
. -
lc_dens()
: makes a density plot. Is an extension oflc_line
.
Available properties
You can read more about different properties here.
-
value
- vector of data values. -
nbins
- (only forlc_hist
) number of bins.
These functions are extensions of lc_line
(lc_dens
) or lc_bars
(lc_hist
) and therefore also accept all their properties.
Examples
## Not run:
lc_hist(dat(value = rnorm(1000), nbins = 30, height = 300))
lc_dens(dat(value = rnorm(1000), height = 300))
## End(Not run)