plot.can_cor: Plots an object of class can_cor

View source: R/can_cor.R

plot.can_corR Documentation

Plots an object of class can_cor

Description

Graphs of the Canonical Correlation Analysis

Usage

## S3 method for class 'can_cor'
plot(
  x,
  type = 1,
  plot_theme = theme_metan(),
  size.tex.lab = 12,
  size.tex.pa = 3.5,
  x.lab = NULL,
  x.lim = NULL,
  x.breaks = waiver(),
  y.lab = NULL,
  y.lim = NULL,
  y.breaks = waiver(),
  axis.expand = 1.1,
  shape = 21,
  col.shape = "orange",
  col.alpha = 0.9,
  size.shape = 3.5,
  size.bor.tick = 0.3,
  labels = FALSE,
  main = NULL,
  ...
)

Arguments

x

The waasb object

type

The type of the plot. Defaults to type = 1 (Scree-plot of the correlations of the canonical loadings). Use type = 2, to produce a plot with the scores of the variables in the first group, type = 3 to produce a plot with the scores of the variables in the second group, or type = 4 to produce a circle of correlations.

plot_theme

The graphical theme of the plot. Default is plot_theme = theme_metan(). For more details,see ggplot2::theme().

size.tex.lab

The size of the text in axis text and labels.

size.tex.pa

The size of the text of the plot area. Default is 3.5.

x.lab

The label of x-axis. Each plot has a default value. New arguments can be inserted as x.lab = 'my label'.

x.lim

The range of x-axis. Default is NULL (maximum and minimum values of the data set). New arguments can be inserted as x.lim = c(x.min, x.max).

x.breaks

The breaks to be plotted in the x-axis. Default is authomatic breaks. New arguments can be inserted as x.breaks = c(breaks)

y.lab

The label of y-axis. Each plot has a default value. New arguments can be inserted as y.lab = 'my label'.

y.lim

The range of y-axis. Default is NULL. The same arguments than x.lim can be used.

y.breaks

The breaks to be plotted in the x-axis. Default is authomatic breaks. The same arguments than x.breaks can be used.

axis.expand

Multiplication factor to expand the axis limits by to enable fitting of labels. Default is 1.1.

shape

The shape of points in the plot. Default is 21 (circle). Values must be between 21-25: 21 (circle), 22 (square), 23 (diamond), 24 (up triangle), and 25 (low triangle).

col.shape

A vector of length 2 that contains the color of shapes for genotypes above and below of the mean, respectively. Defaults to "orange". c("blue", "red").

col.alpha

The alpha value for the color. Default is 0.9. Values must be between 0 (full transparency) to 1 (full color).

size.shape

The size of the shape in the plot. Default is 3.5.

size.bor.tick

The size of tick of shape. Default is 0.3. The size of the shape will be size.shape + size.bor.tick

labels

Logical arguments. If TRUE then the points in the plot will have labels.

main

The title of the plot. Defaults to NULL, in which each plot will have a default title. Use a string text to create an own title or set to main = FALSE to omit the plot title.

...

Currently not used.

Value

An object of class gg, ggplot.

Author(s)

Tiago Olivoto tiagoolivoto@gmail.com

Examples


library(metan)
cc1 = can_corr(data_ge2,
               FG = c(PH, EH, EP),
               SG = c(EL, ED, CL, CD, CW, KW, NR))
plot(cc1, 2)

cc2 <-
data_ge2 %>%
mean_by(GEN) %>%
column_to_rownames("GEN") %>%
can_corr(FG = c(PH, EH, EP),
               SG = c(EL, ED, CL, CD, CW, KW, NR))
plot(cc2, 2, labels = TRUE)




metan documentation built on March 7, 2023, 5:34 p.m.