Skip to contents

The sfPackaging() function is a simple function that groups consecutive slices of recently-sliced RTE seafood into packages of finished product.

Usage

sfPackaging(data = list(), slicesPerPack)

Arguments

data

a list with a minimum of elements:

N

(CFU) A matrix of size number of lots by number of slices, containing the numbers of L. monocytogenes per slice unit;

P

Mean prevalence of contaminated slices (scalar).

slicesPerPack

Number of slices per pack (scalar).

Value

the data object with modified:

N

(CFU) A matrix of size number of lots by number of packs, containing the numbers of L. monocytogenes per pack unit.

Note

If the actual number of slices is not a multiple of the number of slices per pack, some slices will be discarded with a warning. The prevalence P is not intended to change since at that step, zeroes will be retained. No cross-contamination is assumed during packaging.

Author

Regis Pouillot rpouillot.work@gmail.com

Examples

columns <- 200
rows <- 10
slicesPerPack <- 5
dat <- Lot2LotGen(
                  nLots = 50,
                  sizeLot = 100,
                  unitSize = 500,
                  betaAlpha = 0.5112,
                  betaBeta = 9.959,
                  C0MeanLog = 1.023,
                  C0SdLog = 0.3267,
                  propVarInter = 0.7
                  )
dat$N[1, ] <- 1 # To check packages
N1 <- sfPackaging(dat, 5)
# Check the change of dimension
dim(dat$N)
#> [1]  50 100
dim(N1$N)
#> [1] 50 20
# Check the mass balance of slices
sum(dat$N)
#> [1] 1853671
sum(N1$N)
#> [1] 1853671
# Check the packaging (should be TRUE)
all(N1$N[1, ] == slicesPerPack)
#> [1] TRUE
N2 <- sfPackaging(dat, 2)