View source: R/proportionate.R
proportionate | R Documentation |
A Number Multiplies Proportions Under Limitations
proportionate(
number,
result_sum_strict = NULL,
prop,
prop_sum_strict = NULL,
digits = 0
)
number |
A number |
result_sum_strict |
The limitation of the sum of results |
prop |
The proportions to be multiplied by the number |
prop_sum_strict |
The limitation of the sum of proportions |
digits |
The number of decimal places |
## Save 1 decimal place
a <- proportionate(number = 355,
prop = c(0.2, 0.6, 0.15, 0.36),
digits = 1)
## The sum of the proportions is 1
b <- proportionate(number = 355,
prop = c(0.2, 0.6, 0.15, 0.05),
prop_sum_strict = 1,
digits = 1)
## Save 0 decimal place
c <- proportionate(number = 355,
prop = c(0.2, 0.6, 0.15, 0.05),
prop_sum_strict = 1,
digits = 0)
## The sum of the results is 355
d <- proportionate(number = 355,
result_sum_strict = 355,
prop = c(0.2, 0.6, 0.15, 0.05),
prop_sum_strict = 1,
digits = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.