I am trying to format an R markdown file so that I have a table to the right of my created plot. Below is the code in my .Rmd file and a picture of what that code produces.
---
title: "test"
output:
pdf_document:
keep_tex: false
date: "2024-09-06"
header-includes:
usepackage{booktabs}
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(knitr)
library(ggplot2)
library(dplyr)
library(kableExtra)
```
```{=tex}
begin{minipage}[c]{0.3textwidth}
centering
end{minipage}
begin{minipage}[c]{0.3textwidth}
centering
end{minipage}
```
```{r plp, echo=FALSE, warning=FALSE, fig.width=4,fig.height=3, fig.align='left'}
plot(cars)
data <- head(mtcars)
data %>%
kable(format = 'latex',linesep='',valign = 't', label = 'Cars', escape = FALSE, booktabs = TRUE
) %>% kable_styling(latex_options = "HOLD_position", position = "center")
```
Recognized by R Language Collective
1