Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
24 lines
514 B
R
24 lines
514 B
R
% Generated by roxygen2: do not edit by hand
|
|
% Please edit documentation in R/utils.R
|
|
\name{safe_ratio}
|
|
\alias{safe_ratio}
|
|
\title{Safely take a ratio and do not fail if 0 is in the denominator}
|
|
\usage{
|
|
safe_ratio(num, denom)
|
|
}
|
|
\arguments{
|
|
\item{num}{numerator, a numeric}
|
|
|
|
\item{denom}{denominator, a numeric}
|
|
}
|
|
\value{
|
|
The proportion, safely calculated with 0.1 substituting for 0
|
|
}
|
|
\description{
|
|
Safely take a ratio and do not fail if 0 is in the denominator
|
|
}
|
|
\examples{
|
|
safe_ratio(100, 1)
|
|
safe_ratio(100, 0)
|
|
}
|