assignComp: Assign pens to compartments

Description Usage Arguments Value Examples

View source: R/assignComp.R

Description

Assign pens to their compartment randomly but balanced over sex, treatment, and as much as possible over weight class

Usage

1
assignComp(data, nPC = 8, etime = 10)

Arguments

data

data.table with columns Sex (sex of piglets), Gew_klasse (weight class), Beh (Treatment), and Hok (Pen)

nPC

numeric number of pens per compartment

etime

numeric number of seconds to allow iterations before dropping the stringency for level of balance to strive for in weight class distribution over compartments

Value

data.table with added column Comp (compartment)

Examples

1
2
3
4
animalsInTrial <- selectTrialAnimals(biggen,72,72,5.4,9.5)[[1]]
animalsInTrial <- assignPens(animalsInTrial,6)
animalsInTrial <- assignTreatment(animalsInTrial,c("Wit","Groen","Rood","Geel"))
animalsInTrial <- assignComp(animalsInTrial)

DataZhukov/animalTrial documentation built on Dec. 17, 2021, 4:08 p.m.