facet_sample | R Documentation |
This function requires a tbl_ts
object, which can be created with
tsibble::as_tsibble()
. Under the hood, facet_strata
is powered by
stratify_keys()
and sample_n_keys()
.
facet_sample(
n_per_facet = 3,
n_facets = 12,
nrow = NULL,
ncol = NULL,
scales = "fixed",
shrink = TRUE,
strip.position = "top"
)
n_per_facet |
Number of keys per facet you want to plot. Default is 3. |
n_facets |
Number of facets to create. Default is 12 |
nrow , ncol |
Number of rows and columns. |
scales |
Should scales be fixed ( |
shrink |
If |
strip.position |
By default, the labels are displayed on the top of
the plot. Using |
a ggplot object
library(ggplot2)
ggplot(heights,
aes(x = year,
y = height_cm,
group = country)) +
geom_line() +
facet_sample()
ggplot(heights,
aes(x = year,
y = height_cm,
group = country)) +
geom_line() +
facet_sample(n_per_facet = 1,
n_facets = 12)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.