matrix.cross_table {kidney.epi} | R Documentation |
Creates a named matrix from two variables.
Description
Creates a named matrix from two variables.
Usage
matrix.cross_table(var1, var2, predefined_levels = NA)
Arguments
var1 |
Character vector. Values representing first variable. |
var2 |
Character vector. Values representing second variable. |
predefined_levels |
Character vector. Levels for var1 and var2. If omitted, the variables just coded according to the levels they have. If contains vector, the variables are coded according to predefined_levels values, the latter could be useful if var1 and var2 contain not all levels of interest |
Details
Creates a named matrix from two variables.
Value
matrix with cross-tabulation of var1 and var2.
[Package kidney.epi version 1.4.0 Index]