1

I'm using stargazer for tables but everytime I knit to pdf it doesn't read the latex code and my pdf does not have a table. How do i get rmarkdown to produce an actual table? enter image description here

I've tried lots of different stargazer tables, but they all have this same output when i knit to pdf.

bee761
  • 25
  • 3
  • 1
    please share your r markdown code as well. If you can the data that would also help. – Mike Oct 25 '22 at 15:24

1 Answers1

0

There is an asis option in markdown.

---
title: "stargazer in markdown"
author: "Me"
date: "2023-01-11"
output:
  pdf_document: default
  html_document:
    df_print: paged
---

## Stargazer 

```{r}
library(stargazer)
model <- lm(mpg ~ cyl + disp + hp, data=mtcars)
```

```{r, results='asis'}
stargazer(model)
```

enter image description here

Marco
  • 2,368
  • 6
  • 22
  • 48