plotCor: scatter plot with correlation statistics

View source: R/plotUtils.R

plotCorR Documentation

scatter plot with correlation statistics

Description

scatter plot with correlation statistics

Usage

plotCor(
  x,
  y,
  outliers,
  cor.method = c("pearson", "kendall", "spearman"),
  line.methods = c("ols", "tls"),
  na.rm = TRUE,
  circular = FALSE,
  cor.legend = TRUE,
  line.legend = FALSE,
  title = FALSE,
  line.col = c(1, 2),
  pch = 20,
  cex = 1,
  legpos,
  legbg = "#FFFFFF99",
  legcex = cex,
  signif = 1,
  round = 2,
  density = TRUE,
  col,
  ...
)

Arguments

x

the x coordinates of the points in the plot.

y

the y coordinates of the points in the plot.

outliers

vector of indices or logical vector of x,y values to exclude from correlation analysis.

cor.method

method to calculate correlation and p-value via cor.test.

line.methods

regression line methods, where "ols" is a linear regression (ordinary least squares) with R's lm and "tls" (total least squares) is calculated manually via eigen and cov.

na.rm

remove NA values from x and y.

circular

NOT fully implement, treat data as circular.

cor.legend

plot correlation, p-value and slope (TLS) as a legend.

line.legend

plot line fit method as a legend.

title

plot correlation parameters (as in legend) on the top of the plot.

line.col

colors of the regression lines drawn with line.methods. ## @param line.type line types of the regression lines drawn with ## line.methods.

pch

point symbols.

cex

point size.

legpos

position of the legend.

legbg

background color of the legend, default: transparent via alpha=0. ## @param col color(s) of plotted points, if density=FALSE, or ## color palette function if density=TRUE (argument ## colf to dense2d).

legcex

font size (cex) of the legend.

signif

number of digits to be shown for p-values in the plot legend (argument digits to signif.

round

number of decimal places to be shown for correlation values in the plot legend (argument digits to round.

density

indicate local point densities by using dense2d instead of the base plot function.

col

point color if density==FALSE.

...

further arguments to the plotting function; plot or, if density=TRUE, dense2d.


raim/segmenTools documentation built on Sept. 25, 2024, 5:38 p.m.