A function to summarize AlphaPart object.
summary.AlphaPart.RdBreedng values of individuals are often summarized,
either by year of birth or some other classification. Function
summary.AlphaPart provides a way to ease the computation of
such summaries on partitions of breeding values.
Usage
# S3 method for class 'AlphaPart'
summary(object, by, FUN, labelSum, subset,
sums, cov, ...)Arguments
- object
AlphaPart, output object from
AlphaPartfunction.- by
Character, the name of a column by which summary function FUN should be applied; if
NULL(default) summary is given for the whole table.- FUN
Function, which function should be used in summary; function should return single value per each level of by.
- labelSum
Character, label used for the overall breeding value.
- subset
Logical, perform summary only on a subset of
objectsubsetted by this argument.- sums
Logical, link between
AlphaPartandsummary.AlphaPart()(only for internal use!).- cov
Logical, if FALSE returns
nvariances plus one additional column containing two times the sum of all covariances; otherwise returnsnvariance andn(n-1)/2covariances in the form of2*Cov(., .), wherenis the number of partitions. This argument only works whenFUN = var. Defautcov = FALSE.- ...
Arguments passed to other functions (not used at the moment).
Value
An object of class summaryAlphaPart, which is a list
of data frames with summary statistics on breeding value
partitions. For each trait there a dataframe holds summary for the
"whole/original" breeding value and its partitions. In addition
another list is added (named info) with the following
components holdinfg meta info:
pathcolumn name holding path informationnPnumber of pathslPpath labelsnTnumber of traitslTtrait labelsbycolumn name of variable by which summary was performedwarnpotential warning messages associated with this objectlabelSumcolumn name of summary for "whole/original" breeding values
There is a handy plot method (plot.summaryAlphaPart) for output.
See also
AlphaPart for partitioning breeding
values, plot.summaryAlphaPart for plotting
output of summary method
Examples
## --- Partition additive genetic values by loc ---
res <- AlphaPart(x=AlphaPart.ped, colPath="country", colBV=c("bv1", "bv2"))
#>
#> Size:
#> - individuals: 8
#> - traits: 2 (bv1, bv2)
#> - paths: 2 (domestic, import)
#> - unknown (missing) values:
#> bv1 bv2
#> 0 0
## Summarize whole population
ret <- summary(res)
## Summarize population by generation (=trend)
ret <- summary(res, by="gen")
## Summarize population by generation (=trend) but only for domestic location
ret <- summary(res, by="gen", subset=res[[1]]$country == "domestic")
## --- Partition additive genetic values by loc and gender ---
AlphaPart.ped$country.gender <- with(AlphaPart.ped, paste(country, gender, sep="-"))
res <- AlphaPart(x=AlphaPart.ped, colPath="country.gender", colBV=c("bv1", "bv2"))
#>
#> Size:
#> - individuals: 8
#> - traits: 2 (bv1, bv2)
#> - paths: 4 (domestic-F, domestic-M, import-F, import-M)
#> - unknown (missing) values:
#> bv1 bv2
#> 0 0
## Summarize population by generation (=trend)
ret <- summary(res, by="gen")
## Summarize population by generation (=trend) but only for domestic location
ret <- summary(res, by="gen", subset=res[[1]]$country == "domestic")