I want to include outputs of a regression as latex table in rmarkdown as html output. I tried:
regression <- function(analysis_data,formula) {
print(xtable(etable(feols(fml = formula,
data = analysis_data
, cluster = ~ cluservar)
,
keep = c("var1", "var2")), type = "html", include.rownames = F, floating=FALSE))
}
and
regression <- function(analysis_data,formula) {
print(xtable(etable(feols(fml = formula,
data = analysis_data
, cluster = ~ cluservar)
,
keep = c("var1", "var2"), tex = T)
}
with in the header of the chunk of the rmarkdown results = 'asis'
.
My output should be html and my general header of the rmarkdown is:
---
title: "Title"
#author: "Author"
output: html_document
editor_options:
chunk_output_type: inline
---
<style>
div.hidecode + pre {display: none}
</style>
<script>
doclick=function(e){
e.nextSibling.nextSibling.style.display="block";
}
</script>
It doesn't include the output correctly as latex table either way and I don't get why. Thanks for the help!