corscatterplot | R Documentation |
draw cor scatter plot with density plot by ggplot2
corscatterplot(
dat,
x,
y,
color_cor = "blue",
fill_cor = "lightgray",
fill_x = "#ff820e",
fill_y = "#0000fe",
type = "density",
...
)
dat |
plot data |
x |
x |
y |
y |
color_cor |
color for cor reg.line |
fill_cor |
fill for cor reg.line |
fill_x |
fill for top density plot |
fill_y |
fill for right density plot |
type |
whether to use a density plot or a histogram plot for the side panel. |
... |
other paramters for ggscatter |
a ggplot object
Xiaojie Sun
if(requireNamespace("ggpubr",quietly = TRUE)){
corscatterplot(iris,"Sepal.Length","Sepal.Width")
}else{
warning("Package 'ggpubr' needed for this function to work.
Please install it by install.packages('ggpubr')")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.