## EXAMPLE 1:
## Generate some herd test data:
ckey <- rep(1, times = 12)
pkey <- 1:12
lact <- rep(1:2, each = 6)
dim <- c(25,68,105,145,200,240,30,65,90,130,190,220)
llen <- c(280,280,280,280,280,280,NA,NA,NA,NA,NA,NA)
vol <- c(18,30,25,22,18,12,20,32,27,24,20,14)
fat <- c(4.8,4.3,4.5,4.7,4.8,4.9,4.8,4.3,4.5,4.7,4.8,4.9)/100
pro <- c(3.7,3.5,3.6,3.7,3.8,3.9,3.7,3.5,3.6,3.7,3.8,3.9)/100
dat.df01 <- data.frame(ckey, pkey, lact, dim, llen, vol, fat, pro)
## Lactation to date and 305-day milk, fat, and protein yield:
epi.ltd(dat.df01, std = "305")
## Lactation to date and 270-day milk, fat, and protein yield:
epi.ltd(dat.df01, std = "270")
Run the code above in your browser using DataLab