Learn R Programming

SciencesPo (version 0.11.21)

r2tex: Generate Latex Code

Description

It links to the xtable function for generating the latex code.

Usage

r2tex(x, title = NULL)

Arguments

x
is the object to be passed into latex code, usually a table object.
title
A vector with a caption to be pasted into the code.

Value

  • A latex code of the object x.

encoding

UTF-8

References

David B. Dahl (2012) xtable: Export tables to LaTeX or HTML.

Examples

Run this code
data(cgreene76)

tab <- detail(cgreene76, basic = TRUE)

r2tex(tab)

# Everything together 

cap <- "Presidential Election, Brazil (2006)"

r2tex(detail(cgreene76, basic = TRUE), cap)

Run the code above in your browser using DataLab