inst/extdata/digest.R

require(denvax)
require(data.table)

# expected to be called with two arguments
# first: an rds containing a matrix. each row should correspond to a life history
#  columns correspond to a year in life.
#
# second: target rds file to store synthesized populations
.args <- commandArgs(trailingOnly = T)

# load the lifehistory
lifehistories <- readRDS(.args[1])

# compute the proportion coefficients
probs <- denvax::nPxA(lifehistories)

saveRDS(probs, file = tail(.args, 1))

Try the denvax package in your browser

Any scripts or data that you put into this service are public.

denvax documentation built on Dec. 2, 2019, 1:09 a.m.