prop_table: A version of prop.table that takes variables directly (like...

Description Usage Arguments

Description

A version of prop.table that takes any R object that the 'table' function will accept. This, like object_size, is a convenience function so that you don't have to always type prop.table(table(object)). This function allows you to specify the margin of the table as the LAST unnamed argument, meaning that the function works if every argument you pass *after* margin is named. Of course, you can explicitly pass 'margin = n' and then everything should work as expected. For now, if you pass margin as an unnamed argument, it cannot be a vector (unlike in prop.table).

Usage

1
2
3
prop_table(..., margin = 0, exclude = if (useNA == "no") c(NA, NaN),
  useNA = c("no", "ifany", "always"), dnn = list.names(...),
  deparse.level = 1)

Arguments

...

one or more objects which can be parsed by the base table function

margin

index to generate margin for

exclude

levels to remove for all factors in .... If it does not contain NA and useNA is not specified, it implies useNA = "ifany". See ‘Details’ for its interpretation for non-factor arguments.

useNA

whether to include NA values in the table. See ‘Details’. Can be abbreviated.

dnn

the names to be given to the dimensions in the result (the dimnames names).

deparse.level

controls how the default dnn is constructed. See ‘Details’.


graiffgarcia/rrR documentation built on Feb. 12, 2020, 10:34 a.m.