This short vignette provides coding examples on how to use the
functions provided by the aquacultuR package to calculate
Apparent Digestibility Coefficients of feeds, feed
nutrients, and feed ingredients.
library(aquacultuR)
library(magrittr)
library(dplyr)
oldopts <- options()
options(digits = 3)
Note: We could not find any published dataset on digestibility trials in data journals or Open Access repositories (Zenodo, Mendeley Data). We would thus appreciate data contributions from the aquaculture community!
The digestdm dataset contains two fictious diets that differ in their dry matter content and the mass fraction of marker that was found in the feces of an imaginary fish species.
digestdm
#> # A tibble: 2 × 4
#> diet dm std_feed std_feces
#> <chr> <dbl> <dbl> <dbl>
#> 1 diet1 0.9 0.01 0.045
#> 2 diet2 0.95 0.01 0.04
The digestnut dataset contains the same two fictious feeds but the dataset is enriched by fictious total nitrogen contents from which the crude protein content of the samples can be estimated.
digestnut
#> # A tibble: 2 × 6
#> diet dm N_feed std_feed N_feces std_feces
#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 diet1 0.9 0.064 0.01 0.016 0.045
#> 2 diet2 0.95 0.06 0.01 0.016 0.04
While the example data for the dry matter and specific nutrient digestibility calculations provided are constructed, the data for the calculation of ingredient digestibility originates from Bureau et al. (1999) and Bureau and Hua (2006). It contains all required data for a blood meal that was tested for apparent digestibility in the scope of the cited studies.
digestingr
#> # A tibble: 1 × 8
#> diet_reference ingredient adc_reference adc_test dm_reference dm_ingr
#> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 reference diet b blood meal 2 0.923 0.902 0.928 0.895
#> # ℹ 2 more variables: CP_reference <dbl>, CP_ingr <dbl>
Based on the digestdm dataset, the Apparent
Digestibility Coefficient for the dry matter fraction of a feed
(\(\text{ADC}_{\text{DM}}\)) can
immediately be calculated using the adc_dm() function.
digestdm %>%
group_by(diet) %>%
summarise(`ADC DM` = adc_dm(std_diet = std_feed, std_feces = std_feces))
#> # A tibble: 2 × 2
#> diet `ADC DM`
#> <chr> <dbl>
#> 1 diet1 0.778
#> 2 diet2 0.75
Note that the function default for the dry matter content of the feed
is set to 1. This can be changed with the dm argument of
the adc_dm() function. The dry matter content of the feces
cannot be adjusted.
digestdm %>%
group_by(diet) %>%
summarise(`ADC DM` = adc_dm(
dm = dm,
std_diet = std_feed,
std_feces = std_feces
))
#> # A tibble: 2 × 2
#> diet `ADC DM`
#> <chr> <dbl>
#> 1 diet1 0.8
#> 2 diet2 0.762
Applied on a data frame or tibble, the code outputs the \(\text{ADC}_{\text{DM}}\) for each diet.
The Apparent Digestibility Coefficient for specific
nutrients in a feed (\(\text{ADC}_{\text{nut}}\)) can be
calculated analogously with the adc_nut() function. Here,
additional function arguments are the mass fractions of the nutrient of
interest in the feed and the feces in gram per gram.
digestnut %>%
group_by(diet) %>%
summarise(
`ADC CP` = adc_nut(
std_diet = std_feed,
std_feces = std_feces,
nut_diet = N_feed,
nut_feces = N_feces
)
)
#> # A tibble: 2 × 2
#> diet `ADC CP`
#> <chr> <dbl>
#> 1 diet1 0.944
#> 2 diet2 0.933
Lastly, the Apparent Digestibility Coefficient can
also be calculated for the dry matter fraction of a specific ingredient
in a feed (\(\text{ADC}_{\text{ingr}}\)). This is
possible with the adc_ingr() function that
digestingr %>%
summarise(
`ADC Ingredient` = adc_ingr(
adc_test = adc_test,
adc_ref = adc_reference,
nut_ref = CP_reference,
nut_ingr = CP_ingr
)
)
#> # A tibble: 1 × 1
#> `ADC Ingredient`
#> <dbl>
#> 1 0.875
Same as adc_dm(), the function assumes that the dry
matter of the reference feed and the feed ingredient is 1 gram per gram
by default. To change this, the function arguments dm_ref
and dm_ingr can be used. In addition, the mass fraction of
the feed ingredient into the test diet can be set by using the function
argument incl_ingr. The default is 0.3 gram per gram.
digestingr %>%
summarise(
`ADC Ingredient` = adc_ingr(
adc_test = adc_test,
adc_ref = adc_reference,
nut_ref = CP_reference,
nut_ingr = CP_ingr,
dm_ref = dm_reference,
dm_ingr = dm_ingr
)
)
#> # A tibble: 1 × 1
#> `ADC Ingredient`
#> <dbl>
#> 1 0.874
The difference from the result stated in Bureau and Hua (2006) (\(\text{ADC} = 87.5\%\)) originates from rounding of the result.
sessionInfo()
#> R version 4.5.2 (2025-10-31)
#> Platform: x86_64-apple-darwin20
#> Running under: macOS Sequoia 15.7.3
#>
#> Matrix products: default
#> BLAS: /Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.1
#>
#> locale:
#> [1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#>
#> time zone: Europe/Prague
#> tzcode source: internal
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] dplyr_1.1.4 magrittr_2.0.4 aquacultuR_1.1.1
#>
#> loaded via a namespace (and not attached):
#> [1] vctrs_0.7.0 cli_3.6.5 knitr_1.51 rlang_1.1.7
#> [5] xfun_0.56 otel_0.2.0 generics_0.1.4 jsonlite_2.0.0
#> [9] glue_1.8.0 htmltools_0.5.9 sass_0.4.10 rmarkdown_2.30
#> [13] evaluate_1.0.5 jquerylib_0.1.4 tibble_3.3.1 fastmap_1.2.0
#> [17] yaml_2.3.12 lifecycle_1.0.5 compiler_4.5.2 pkgconfig_2.0.3
#> [21] rstudioapi_0.18.0 digest_0.6.39 R6_2.6.1 utf8_1.2.6
#> [25] tidyselect_1.2.1 pillar_1.11.1 bslib_0.9.0 tools_4.5.2
#> [29] cachem_1.1.0
options(oldopts)