I'm trying to add a table that has colour coded columns using the gt
package. It works in the console:
but doesn't work when the pdf is created:
My full markdown is:
---
title: "Untitled"
output: pdf_document
---
```{r setup}
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(gt)
```
## GT package
```{r table1, results='asis'}
starwars %>%
select (name, height, mass, hair_color, skin_color, sex, gender) %>%
head (5) %>%
gt() %>%
tab_style(
style = list(
cell_fill(color = "lightcyan"),
cell_text(weight = "bold")
),
locations = cells_body(
columns = vars(height),
rows = height > 150)
)
```