prop: Create Percentage Tables

View source: R/prop.R

propR Documentation

Create Percentage Tables

Description

This function takes a dataframe and creates a table in percentages. This is an enhanced version of prop.table.

Usage

prop(
  df,
  vars,
  digit = 1,
  sort = NULL,
  head = NULL,
  print = TRUE,
  useNA = "ifany"
)

Arguments

df

Input dataframe.

vars

Variables to be put into table.

digit

Digits under the decimal point to show. Defaults to 1.

sort

Whether to sort the table. Defaults to NULL.

head

Whether to restrict the table to the top few observations. Defaults to NULL.

print

Whether to only print the output, so that no quotes are seen after applying formatC.

useNA

useNA which is an argument for table. Defaults to "ifany."


sysilviakim/Kmisc documentation built on Jan. 28, 2023, 10:58 a.m.