keys_near.data.frame | R Documentation |
Return keys nearest to a given statistics or summary.
## S3 method for class 'data.frame'
keys_near(.data, key, var, top_n = 1, funs = l_five_num, ...)
.data |
data.frame |
key |
key, which identifies unique observations. |
var |
variable to summarise |
top_n |
top number of closest observations to return - default is 1, which will also return ties. |
funs |
named list of functions to summarise by. Default is a given
list of the five number summary, |
... |
extra arguments to pass to |
heights %>%
key_slope(height_cm ~ year) %>%
keys_near(key = country,
var = .slope_year)
# Specify your own list of summaries
l_ranges <- list(min = b_min,
range_diff = b_range_diff,
max = b_max,
iqr = b_iqr)
heights %>%
key_slope(formula = height_cm ~ year) %>%
keys_near(key = country,
var = .slope_year,
funs = l_ranges)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.