Learn R Programming

fastrep (version 0.7)

cross_tbl: cross_tbl

Description

[Experimental]

This function makes cross tables, like all functions from fastrep you need to supply a data.frame, and in this case two variables.

Usage

cross_tbl(obj, var1, var2, title = "", marg = FALSE)

Value

A knitr_kable with 2x2 table fitted

Arguments

obj

Object used to create the table. Data frame, list, or environment (or object coercible by as.data.frame to a data frame)

var1

Variable that you want the table (not written in string format)

var2

Variable that you want on the top of the table (not written in string format)

title

title for the table, write in string format

marg

Marginal row table, default is FALSE

Examples

Run this code
mtcars |>
  fastrep::cross_tbl(cyl, am, "title", marg = TRUE)

Run the code above in your browser using DataLab