drawScatter: Draw scatter plot

View source: R/Common.R

drawScatterR Documentation

Draw scatter plot

Description

Draw scatter plot

Usage

drawScatter(
  xvalue,
  yvalue,
  xlab = "X",
  ylab = "Y",
  group = NA,
  color = "jco",
  title = "",
  remove.legend = FALSE,
  margin = TRUE,
  xlim = NULL,
  ylim = NULL,
  add = "none",
  label = NULL,
  cor.coef = F,
  cor.method = "pearson"
)

Arguments

xvalue

Vector of values

yvalue

The same length wtih x value

color

Default jco

remove.legend

Default FALSE

margin

Default TRUE, show margin plot

add

c("none", "reg.line", "loess")

label

Default NULL

cor.coef

TRUE/FALSE to show coefficient

cor.method

method for computing correlation coefficient. Allowed values are one of "pearson", "kendall", or "spearman"

show.sample.name

Default FALSE

Value

ggplot2 object

Examples

library(ggpubr)
data("mtcars")
loonR::drawScatter(mtcars$wt, mtcars$mpg, xlab = "wt", ylab = "mpg",  remove.legend = T, cor.coef = F)

ProfessionalFarmer/loonR documentation built on Oct. 9, 2024, 9:56 p.m.