funq_plot | R Documentation |
funq_plot()
conditions on variable x
with quantile binning and
plots the median and interquartile range of numerical variables and level frequency
of the other variables as a function the x
variable.
funq_plot(
data,
x = NULL,
n = 100,
min_bin_size = NULL,
overlap = NULL,
color = "#002f2f",
fill = "#2f4f4f",
auto_fill = TRUE,
ncols = NULL,
xmarker = NULL,
qmarker = NULL,
show_bins = FALSE,
xlim = NULL,
connect = TRUE,
...
)
data |
a |
x |
|
n |
|
min_bin_size |
|
overlap |
|
color |
The color to use for the line charts |
fill |
The fill color to use for the areas |
auto_fill |
If |
ncols |
The number of column to be used in the layout |
xmarker |
|
qmarker |
|
show_bins |
if |
xlim |
|
connect |
if |
... |
Additional arguments to pass to the plot functions |
By highlighting and connecting the median values it creates a functional view of the data.
What is the (expected) median given a certain value of x
?
It qbin
s the x
variable and plots the medians of the qbins vs the other variables, thereby
creating a functional view of x
to the rest of the data,
calculating the statistics for each bin, hence the name funq_plot
.
A ggplot object with the plots
Other conditional quantile plotting functions:
cond_barplot()
,
cond_boxplot()
,
cond_heatmap()
funq_plot(iris, "Sepal.Length", xmarker=5.5)
funq_plot(
iris,
x = "Sepal.Length",
xmarker=5.5,
overlap = TRUE
)
data("diamonds", package="ggplot2")
funq_plot(diamonds[1:7], "carat", xlim=c(0,2))
if (require(palmerpenguins)){
funq_plot(
penguins[1:7],
x = "body_mass_g",
xmarker=4650,
ncol = 3
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.