Description Usage Arguments Details Value Examples
A function to plot summary of partitioned breeding values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## S3 method for class 'summaryAlphaPart'
plot(
x,
sortValue = TRUE,
sortValueFUN = sum,
sortValueDec = TRUE,
addSum = TRUE,
paths = NULL,
xlab = NULL,
ylab = NULL,
xlim = NULL,
ylim = NULL,
color,
lineSize = 1,
lineType = 1,
lineTypeList = NULL,
useDirectLabels = TRUE,
method = list(last.qp, hjust = 0),
labelPath = NULL,
...
)
|
x |
summaryAlphaPart, object from the |
sortValue |
Logical, affect legend attributes via sort of paths according to
|
sortValueFUN |
Function, that produces single value for one vector, say |
sortValueDec |
Logical, sort decreasing. |
addSum |
Logical, plot the overall trend. |
paths |
Character or list or characters, name of paths to plot; if |
xlab |
Character, x-axis label. |
ylab |
Character, y-axis label; can be a vector of several labels if there are more traits in |
xlim |
Numeric, a vector of two values with x-axis limits; use a list of vectors for more traits. |
ylim |
Numeric, a vector of two values with y-axis limits; use a list of vectors for more traits. |
color |
Character, color names; by default a set of 54 colors is predefined from the RColorBrewer package; in addition a black colour is attached at the begining for the overall trend; if there are more paths than colors then recycling occours. |
lineSize |
Numeric, line width. |
lineType |
Numeric, line type (recycled); can be used only if lineTypeList=NULL. |
lineTypeList |
List, named list of numeric values that help to point out a set of paths
(distinguished with line type) within upper level of paths (distinguished by,
color), e.g., lineTypeList=list("-1"=1, "-2"=2, def=1) will lead to use
of line type 1 for paths having "-1" at the end of path name and line type 2,
for paths having "-2" at the end of path name, while line type 1 (default) will,
be used for other paths; specification of this argument also causes recycling
of colors for the upper level of paths; if NULL all lines have a standard line type,
otherwise |
useDirectLabels |
Logical, use directlabels package for legend. |
method |
List, method for direct.label. |
labelPath |
Character, legend title; used only if |
... |
Arguments passed to other functions (not used at the moment). |
Information in summaries of partitions of breeding values can be overhelming due to a large volume of numbers. Plot method can be used to visualise this data in eye pleasing way using ggplot2 graphics.
A list of ggplot objects that can be further modified or displayed.
For each trait in x
there is one plot visualising summarized values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | ## Partition additive genetic values by country
(res <- AlphaPart(x=AlphaPart.ped, colPath="country", colBV=c("bv1", "bv2")))
## Summarize population by generation (=trend)
(ret <- summary(res, by="gen"))
## Plot the partitions
p <- plot(ret, ylab=c("bv for trait 1", "bv for trait 2"), xlab="Generation")
print(p[[1]]$abs)
print(p[[2]]$abs)
print(p)
## Partition additive genetic values by country and sex
AlphaPart.ped$country.gender <- with(AlphaPart.ped, paste(country, gender, sep="-"))
(res <- AlphaPart(x=AlphaPart.ped, colPath="country.gender", colBV=c("bv1", "bv2")))
## Summarize population by generation (=trend)
(ret <- summary(res, by="gen"))
## Plot the partitions
p <- plot(ret, ylab=c("BV for trait 1", "BV for trait 2"), xlab="Generation")
print(p)
p <- plot(ret, ylab=c("BV for trait 1", "BV for trait 2"), xlab="Generation",
lineTypeList=list("-1"=1, "-2"=2, def=3))
print(p)
p <- plot(ret, ylab=c("BV for trait 1", "BV for trait 2"), xlab="Generation",
lineTypeList=list("-1"=1, "-2"=2, def=3), useGgplot2=FALSE, useDirectLabels = FALSE)
print(p)
## Plot control (color and type of lines + limits)
p <- plot(ret, ylab=c("BV for trait 1", "BV for trait 2"), xlab="Generation",
useGgplot2=TRUE, color=c("green", "gray"), lineType=c(2, 3),
sortValue=FALSE, lineSize=4,
xlim=c(-1, 7))
print(p)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.