tidypptsda cleans and analyses visit records from automatic pig feeding stations (NEDAP and FIRE): body weight cleaning, average daily gain (ADG), feed intake correction (ADFI) and feed conversion ratio (FCR).
removed table with the reason.Cheatsheet: English, 中文. Documentation (in Chinese): 快速入门; all articles by topic (data, methods, results, validation) are in the article index. To plan pig entries into the testing stations (all-in/all-out, back-scheduled or weekly-batch rolling groups), use the planner.
# install.packages("pak")
pak::pak("tony2015116/tidypptsda")Version 0.1.0 (the earlier API) stays available:
pak::pak("tony2015116/tidypptsda@v0.1.0")
library(tidypptsda)
res <- run_pipeline(nedap, verbose = 0)
res
head(res$fcr$per_pig[, .(responder, adg, adfi, fcr, fcr_flag)])
#> responder adg adfi fcr fcr_flag
#> 1: 13913 1209.897 2642.654 2.184196 ok
#> 2: 13918 1162.966 2566.372 2.206747 ok
#> 3: 13954 1124.224 2681.418 2.385127 low_confidence
#> 4: 13996 1334.979 2860.245 2.142538 ok
#> 5: 14962 1278.746 2830.550 2.213536 ok
#> 6: 15006 1317.472 3121.544 2.369343 okStep by step, with any QC setting:
qc <- qc_config(stage_range = c(30, 120))
visits <- prep_visits(fire, qc = qc) # or read_station("export/")
weight <- clean_weight(visits, qc)
adg <- calc_adg(weight)
adfi <- calc_adfi(visits, adg)
fcr <- calc_fcr(adg, adfi)
plot_adg(adg, weight = weight) |> save_plots("plots", suffix = "growth")
write_report(run_pipeline(fire), "report") # HTML report, a page per station
Daily feed intake over the stage: recorded, error-free, corrected and filled days, with the ADFI as a dashed line:

Casey, D. S., Stern, H. S., & Dekkers, J. C. M. (2005). Identification of errors and factors associated with errors in data from electronic swine feeders. Journal of Animal Science, 83, 969-982.
Jiao, S., Maltecca, C., Gray, K. A., & Cassady, J. P. (2014). Feed intake, average daily gain, feed efficiency, and real-time ultrasound traits in Duroc pigs: I. Journal of Animal Science, 92, 2377-2386.