Description Usage Arguments Examples
Calculate the rowwise total number for values is higher than column-average value
1 | add_above_avg_num(.data, ..., .name = "above_avg_num", na.rm = TRUE)
|
.data |
data.frame |
... |
columns selected for rowwise 'sum' or 'mean' using 'tidyselect' grammar |
.name |
the name of new column |
na.rm |
whether to delete the missing value, 'TRUE' or 'FALSE' |
1 2 3 4 5 6 7 8 9 | df <- tribble(
~id, ~x, ~y, ~z, ~g,
#--|--|--|--|--
"a", 13.1, 14, 4, 1,
"b", 11.2, 7, 5, 0,
"c", 12.5, 10, 1, 0,
"d", 20, 11, 3, 1
)
df %>% add_above_avg_num(x:g)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.