get_percentage: Get percentage of tibble variables

View source: R/generics.R

get_percentageR Documentation

Get percentage of tibble variables

Description

The percentage is relative to the variable in from argument

Usage

get_percentage(
  tbl,
  from,
  discard = NULL,
  percent = TRUE,
  keep = FALSE,
  digits = 2
)

Arguments

tbl

tibble or data.frame

from

character, column name of the base variable

discard

character or character vector, columns to discard of the percentage operations (but included in the results)

percent

logical, whether to output the percentages in percent or not

keep

logical, whether to include the base variable in from argument to the output tibble

digits

integer, number of digits to round the percentages

Value

tibble


mcanigueral/dutils documentation built on Jan. 25, 2024, 3:34 p.m.