I am trying to create a latex formatted table in R with a \label{} option.
Something similar to
library(tidyverse)
library(knitr)
library(kableExtra)
data_frame(a = 1:3, b = 2:4) %>%
kable(align = 'c', format = 'latex') %>%
kable_styling(full_width = FALSE)
the resulting output is below, but i would like to add the \label{label_value} parameter to the latex table with a label_value I can define
\begin{table}[H]
\centering
\begin{tabular}{c|c}
\hline
a & b\\
\hline
1 & 2\\
\hline
2 & 3\\
\hline
3 & 4\\
\hline
\end{tabular}
\end{table}
I am trying to automatically create tables in R which I can save and then include in a latex document
\label
parameter placed? You can manually edit the output of kable like a regular string. You just need to make sure you give the resulting strings the attributes from the original output – Enginery