plot.STA: Plot function for class STA

Description Usage Arguments Value See Also Examples

View source: R/createSTA.R

Description

This function draws either four base plots:

or five or six spatial plots:

Spatial plots can only be made if the data contains both row and column information.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## S3 method for class 'STA'
plot(
  x,
  ...,
  trials = NULL,
  traits = NULL,
  what = NULL,
  plotType = c("base", "spatial"),
  spaTrend = c("raw", "percentage"),
  outCols = ifelse(plotType == "base", 2, 3),
  title = NULL,
  output = TRUE
)

Arguments

x

An object of class STA.

...

Further graphical parameters.

trials

A character vector indicating the trials to plot. If trials = NULL, all trials are plotted.

traits

A character vector indicating the traits to plot. If traits = NULL, all traits are plotted.

what

A character string indicating whether the fitted model with genotype as fixed (what = "fixed") or genotype as random (what = "random") factor should be plotted. If x contains only one model this model is chosen automatically.

plotType

A character string indicating whether base plots or spatial plots should be made.

spaTrend

A character string indicating how the spatial trend should be displayed. Either "raw" (original scale), or "percentage". If "percentage", the estimated spatial trend is scaled (i.e., divided by the average of the observed response variable of interest across the field) and results are shown as a percentage.

outCols

An integer indicating the number of columns to use for displaying the plots. Usually the default of 2 for base plots and 3 for spatial plots will be fine, but decreasing the numbers may help for nicer printing.

title

A character string used a title for the plot. Note that when a title is specified and multiple plots are created, all plots will get the same title.

output

Should the plot be output to the current device? If FALSE only a list of ggplot objects is invisibly returned.

Value

A list containing ggplot objects for the selected plots.

See Also

Other functions for STA objects: STAtoCross(), STAtoTD(), report.STA(), summary.STA()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Run a single trait analysis using SpATS.
modSp <- fitTD(TD = TDHeat05,
               design = "res.rowcol",
               traits = "yield")

## Create base plots.
plot(modSp,
     what = "fixed",
     plotType = "base")

## Create spatial plots.
plot(modSp,
     what = "fixed",
     plotType = "spatial")

## Create spatial plots showing the spatial trend as percentage.
plot(modSp,
     what = "fixed",
     plotType = "spatial",
     spaTrend = "percentage")

statgenSTA documentation built on May 25, 2021, 5:11 p.m.