Learn R Programming

AlphaPart (version 0.7.0)

summary.AlphaPart: summary.AlphaPart.R

Description

A function to summarize AlphaPart object.

Usage

# S3 method for AlphaPart
summary(object, by = NULL, FUN = mean,
  labelSum = "Sum", subset = NULL, sums = FALSE, ...)

Arguments

object

AlphaPart, output object from AlphaPart function.

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 additive genetic value.

subset

Logical, perform summary only on a subset of object subsetted by this argument.

sums

Logical, link between AlphaPart and summary.AlphaPart() (only for internal use!).

...

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 additive genetic value partitions. For each trait there is a list component holding two dataframes. The first data.frame is called abs and holds summary for the "whole/original" additive genetic value and its partitions, while the second data.frame is called rel and holds relative values of abs counterpart. In addition another list is added (named info) with the following components holdinfg meta info:

path

column name holding path information

nP

number of paths

lP

path labels

nT

number of traits

lT

trait labels

by

column name of variable by which summary was performed

warn

potential warning messages associated with this object

labelSum

column name of summary for "whole/original" additive genetic values

There is a handy plot method (plot.summaryAlphaPart) for output.

Details

Additive genetic 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 additive genetic values.

See Also

AlphaPart for partitioning additive genetic values, plot.summaryAlphaPart for plotting output of summary method

Examples

Run this code
# NOT RUN {
## Load an example data
data("AlphaPart.ped")

## --- Partition additive genetic values by loc ---
(res <- AlphaPart(x=AlphaPart.ped, colPath="loc", colAGV=c("agv1", "agv2")))

## Summarize whole population
(ret <- summary(res))

## Summarize population by generation (=trend)
(ret <- summary(res, by="gen"))

## Summarize population by generation (=trend) and location 1
(ret <- summary(res, by="loc.gen"))

## Summarize population by generation (=trend) but only for location 1
(ret <- summary(res, by="gen", subset=res[[1]]$loc == 1))

## --- Partition additive genetic values by loc and sex ---

AlphaPart.ped$loc.sex <- with(AlphaPart.ped, paste(loc, sex, sep="-"))
(res <- AlphaPart(x=AlphaPart.ped, colPath="loc.sex", colAGV=c("agv1", "agv2")))

## Summarize population by generation (=trend)
(ret <- summary(res, by="gen"))

## Summarize population by generation (=trend) and location 1
(ret <- summary(res, by="loc.gen"))

## Summarize population by generation (=trend) but only for location 1
(ret <- summary(res, by="gen", subset=res[[1]]$loc == 1))
# }

Run the code above in your browser using DataLab