corscatterplot {tinyarray}R Documentation

corscatterplot

Description

draw cor scatter plot with density plot by ggplot2

Usage

corscatterplot(
  dat,
  x,
  y,
  color_cor = "blue",
  fill_cor = "lightgray",
  fill_x = "#ff820e",
  fill_y = "#0000fe",
  type = "density",
  ...
)

Arguments

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

Value

a ggplot object

Author(s)

Xiaojie Sun

Examples

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')")
}

[Package tinyarray version 2.4.2 Index]