f_radii_and_heights2: Find cylinders' radii and heights

View source: R/f_radii_and_heights.r

f_radii_and_heights2R Documentation

Find cylinders' radii and heights

Description

This function returns cylinder radii and heights, such that the corresponding cylinder volumes have determined characteristics. For the chosen N heights (heights), it returns an Nx2 Matrix whose first column contains the heights and and the second column contains the corresponding radii. It works in two modes: 1) if baseline.matrix and target.n.event are provided (but rho is not), the function computes the volume (such that each cylinder contains around target.n.event events given the baseline); this is the mode used in Cavallaro, M. et al (2022) PLoS Comput Biol 18(11): e1010726 https://doi.org/10.1371/journal.pcbi.1010726 . 2) if rho is provided (but baseline.matrix and target.n.event are not) the functions computes the largest volume as $pi * rho^2$. All other radii are computed with heights from heights such the the cylinder volumes are constant.

Usage

f_radii_and_heights2(heigths, baseline.matrix, target.n.event, rho)

Arguments

heigths

integer.

baseline.matrix

A Matrix encoding the baseline.

target.n.event

An integer, representing the desired expected number of events in each cylinder. It requires a baselineline matrix to be passed.

rho

A numeric. It is the maximum

Value

A Matrix.

Examples

radii_and_heights = f_radii_and_heights2(1:16, baseline.matrix, 100)
radii_and_heights = f_radii_and_heights2(1:16, rho=1.6446127)

mcavallaro/rancovr documentation built on April 17, 2025, 7:21 p.m.