And then the individual lik1-3 and cause1-3 variables can be created as top3[1] and names(top3)[1] (and so on), respectively. Or, if separate variables are not needed, the appropriate elements from the top3 vector can be directly referenced in the final output step.
https://github.com/verbal-autopsy-software/InterVA4/blob/792fd94fcad1f143f55865e580a4ea0bc233e5bb/InterVA4_1.7/R/InterVA.R#L430-L444
This code is hard to follow and likely inefficient, given the separate steps. We believe it can be condensed to:
And then the individual
lik1-3
andcause1-3
variables can be created astop3[1]
andnames(top3)[1]
(and so on), respectively. Or, if separate variables are not needed, the appropriate elements from thetop3
vector can be directly referenced in the final output step.