assignPens: Assign piglets to pens

Description Usage Arguments Value Examples

View source: R/assignPens.R

Description

Assign piglets to their pens keeping standard deviation in average weight per pen to a minimum.

Usage

1
assignPens(data, nH, nWC = 3, separateSex = T)

Arguments

data

data.table with columns Zeugnr (sow ID), Sex (sex of piglets), and Speen_gew (weaning weights of piglets)

nH

numeric number of piglets to be housed in each pen

nWC

numeric number of weight classes to be created (default = 3)

separateSex

boolean Should barrows and gilts be kept in separate pens (default = TRUE)? If FALSE, the number of barrows and gilts should be equal in total and per pen.

Value

data.table with added column Hok (pen)

Examples

1
2
animalsInTrial <- selectTrialAnimals(biggen,72,72,5.4,9.5)[[1]]
animalsInTrial <- assignPens(animalsInTrial,6)

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