Learn R Programming

agriutilities (version 1.2.1)

plot.smaAgri: Plot an object of class smaAgri

Description

Create several plots for an object of class smaAgri

Usage

# S3 method for smaAgri
plot(
  x,
  type = c("summary", "correlation", "spatial"),
  filter_traits = NULL,
  nudge_y_cv = 3,
  nudge_y_h2 = 0.07,
  horizontal = FALSE,
  theme_size = 15,
  axis_size = 8,
  text_size = 4,
  ...
)

Value

A ggplot object.

Arguments

x

An object inheriting from class smaAgri resulting of executing the function single_trial_analysis()

type

A character string specifiying the type of plot. "summary", "correlation" or "spatial".

filter_traits

An optional character vector to filter traits.

nudge_y_cv

Vertical adjustment to nudge labels by when plotting CV bars. Only works if the argument type is "summary". 3 by default.

nudge_y_h2

Vertical adjustment to nudge labels by when plotting h2 bars. Only works if the argument type is "summary". 0.07 by default.

horizontal

If FALSE, the default, the labels are plotted vertically. If TRUE, the labels are plotted horizontally.

theme_size

Base font size, given in pts. 15 by default.

axis_size

Numeric input to define the axis size.

text_size

Numeric input to define the text size.

...

Further graphical parameters. For future improvements.

Author

Johan Aparicio [aut]

Examples

Run this code
# \donttest{
library(agridat)
library(agriutilities)
data(besag.met)
dat <- besag.met
results <- check_design_met(
  data = dat,
  genotype = "gen",
  trial = "county",
  traits = c("yield"),
  rep = "rep",
  block = "block",
  col = "col",
  row = "row"
)
out <- single_trial_analysis(results, progress = FALSE)
print(out)
plot(out, type = "summary", horizontal = TRUE)
plot(out, type = "correlation")
plot(out, type = "spatial")
# }

Run the code above in your browser using DataLab