Is there a simple way to automatically remove the
\begin{tabular}{@{\extracolsep{5pt}}lc}
and
\end{tabular}
lines at the beginning and end of a Stargazer LaTeX output?
Indeed, I just need the inside LaTeX code and removing those lines manually from the TeX file generated by stargazer is a complete loss of time...
Each of the functions defined to create the LaTeX output in stargazer
are defined within the (internal) wrapper function .stargazer.wrap
. As such, it's not that easy to update the components automatically. You'll either have to make a copy of the package that you maintain locally, or edit the .stargazer.wrap
function every time you load the package.
Here's how to do the latter, following the guidelines from How do I override a non-visible function in the package namespace? (managing your own copy would entail something similar):
Load stargazer
:
> library(stargazer)
Edit the .stargazer.wrap
function inside the stargazer
namespace/package:
> fixInNamespace(".stargazer.wrap", pos="package:stargazer")
Find and remove at least rows 4206-4207 from the .data.frame.table.header
function:
These two lines are used to print the tabular
header.
Find and remove at least row 3385 in the .publish.table
function:
This line prints \end{tabular}
(plus a line break).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With