Learn R Programming

AgroReg (version 1.2.10)

correlation: Graph: Plot correlation

Description

Correlation analysis function (Pearson or Spearman)

Usage

correlation(
  x,
  y,
  method = "pearson",
  ylab = "Dependent",
  xlab = "Independent",
  theme = theme_classic(),
  textsize = 12,
  pointsize = 5,
  pointshape = 21,
  linesize = 0.8,
  fill.ic = "gray70",
  alpha.ic = 0.5,
  ic = TRUE,
  title = NA,
  fontfamily = "sans"
)

Value

The function returns a graph for correlation

Arguments

x

Numeric vector with independent variable

y

Numeric vector with dependent variable

method

Method correlation (default is Pearson)

ylab

Variable response name (Accepts the expression() function)

xlab

Treatments name (Accepts the expression() function)

theme

ggplot2 theme (default is theme_classic())

textsize

Axis text size

pointsize

Point size

pointshape

shape format

linesize

line size

fill.ic

Color interval of confidence

alpha.ic

confidence interval transparency level

ic

Add interval of confidence

title

title

fontfamily

Font family

Author

Gabriel Danilo Shimizu, shimizu@uel.br

Leandro Simoes Azeredo Goncalves

Examples

Run this code
data("aristolochia")
with(aristolochia, correlation(trat,resp))

Run the code above in your browser using DataLab