prop.yes: get percentage of positive answers in a vector

View source: R/general_funcs.R

prop.yesR Documentation

get percentage of positive answers in a vector

Description

get percentage of positive answers in a vector

Usage

prop.yes(
  x,
  cutoff = 1,
  round = T,
  digits = 2L,
  restrict = F,
  restrict_level = 10L
)

Arguments

x

a vector

cutoff

a vector defining positive answers, default = 1 in a binary dataset

round

TRUE/FALSE, default = T

digits

no. of digits to round, default = 2

restrict

should answers be restricted to 'NA' when n < 10 'NA', default F

restrict_level

the number of answers for restriction: if n is below restrict level, answer is turned to NA


cathblatter/shurp2018 documentation built on Jan. 11, 2023, 11:29 a.m.