View source: R/calc_max_precision.R
| calc_max_precision | R Documentation |
This function determines the mode of a variable 'x', filtered to entries with the maximum value of a specified precision vector 'precision_var'. It optionally resolves ties using one or two additional vectors for tie-breaking.
calc_max_precision(x, precision_var, tie_break = NULL, second_tie_break = NULL)
x |
A vector of values for which to find the mode. |
precision_var |
A vector of precision values corresponding to 'x', used to filter to maximum values. |
tie_break |
Optional; a vector used as the first tie-break criterion. |
second_tie_break |
Optional; a vector used as the second tie-break criterion. |
Returns the mode of 'x' for entries with maximum 'precision_var' value. If no valid entries exist, returns an empty string.
x = c("apple", "apple", "banana", "banana")
precision_var = c(1, 2, 1, 2)
tie_break = c(1, 2, 1, 2)
second_tie_break = c(1, 1, 2, 1)
calc_max_precision(x, precision_var, tie_break, second_tie_break)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.