How to adjust row height in kable, so the table looks not so crowded in pdf output. Thanks in advance!
title: ''
geometry: margin=2cm
output:
pdf_document:
latex_engine: xelatex
urlcolor: blue
classoption: landscape
knitr::opts_chunk$set(echo = FALSE)
knitr::opts_chunk$set(dev = 'pdf', fig.width = 12, fig.height = 7)
library(tidyverse)
library(kableExtra)
library(data.table)
test <- mtcars
test1 <- setDT(test, keep.rownames = TRUE[]) %>%
select(rn,cyl,mpg) %>% filter(cyl==4)
cat("\n\n\\pagebreak\n")
carsub <- test1 %>%
select(
"Car Name and Model"=rn,
"Cylinders"=cyl,
"Mileage Per Gallon"=mpg)
carsub %>%
kable(digits=1) %>% column_spec(1, width="11cm",border_left = TRUE) %>%
column_spec(2:4, width="1.8cm") %>%
column_spec(5,width="1.8cm",border_right = TRUE)%>%
kable_styling("bordered", font_size = 11)