add_above_avg_num: Calculate the rowwise total number for values is higher than...

Description Usage Arguments Examples

View source: R/rowwise.R

Description

Calculate the rowwise total number for values is higher than column-average value

Usage

1
add_above_avg_num(.data, ..., .name = "above_avg_num", na.rm = TRUE)

Arguments

.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'

Examples

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)

perlatex/easyuse documentation built on April 14, 2020, 5:35 a.m.