data-cowbw: Cow body weight

Description Usage Format Details Examples

Description

Body weight of cows througout a lactation for 48 cows.

Usage

1

Format

cowid:

Identifier of cow

tfc:

Time from calving in days

bw:

Body weight

Details

There are 48 cowids in cowbw; cowbw2 contains data for the first six cowids.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
require(ggplot2)
data(cowbw2)

qplot(tfc, bw, data=cowbw2, colour=cowid) + geom_path()

cowlst <- cowbw2 %>% split(.$cowid)

i <- 2
dd <- cowlst[[i]]
tvar <- dd$tfc
yvar <- dd$bw

f1 <- ses(yvar, tvar)
f2 <- des(yvar, tvar)

plot(f1)
at <- seq(10, 310, by=20)
forecast_lines(f1, at=at, ahead=0:20, col='red', lwd=3)
forecast_lines(f2, at=at, ahead=0:20, col='blue', lwd=3)

hojsgaard/dataIrony documentation built on May 17, 2019, 7:06 p.m.