Learn R Programming

evobiR (version 1.1)

ResSel: Selection on Residuals

Description

This function takes measurements of multiple traits and performs a linear regression and identifies those records with the largest and smallest residual. Originally it was written to perform a regression of horn size on body size allowing for high and low selection lines.

Usage

ResSel(data, traits, percent = 10, identifier = 1, model = "linear")

Arguments

data
this is a dataframe with subject identifiers and phenotypic trait values
traits
a numeric vector indicating the column containing the predictor and response variables in that order
percent
the percentage of highest and lowest residuals that should be identified
identifier
the column which contains the record numbers to identify individuals
model
currently this is not used

Value

This function returns a list
high line
the ID numbers for the individuals selected for the high line
low line
the ID numbers of the individuals selected for the low line

References

http://coleoguy.github.io/

Examples

Run this code
data <- read.csv(file = system.file("horn.beetle.csv", package = "evobiR"))
ResSel(data = data, traits = c(2,3), percent = 15, identifier = 1, model = "linear")

Run the code above in your browser using DataLab