I have to create a table manually as follows in Rmarkdown.
library(knitr)
library(kableExtra)
x <- cbind(c("Term", "Intercept"),
c( "Estimate", round(2.684698447, digits = 3)),
c("P-value", "$< 2 \\times 10^{-16}$"),
c("Significance", "***"))
knitr::kable(x, align="c", escape = F, caption = "Summary of the fitted linear model with miles per gallon as the response variable. Significance codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1",
booktabs = T) %>%
kable_styling("hover", full_width = F, font_size = 11, latex_options = "hold_position"
)%>%
row_spec(0, bold = T, font_size = 12) %>%
column_spec(1, border_right = TRUE) %>%
row_spec(3, hline_after = TRUE)
and the table looks like this:
However, I want a line to be below the header. How should I do that?