I am new to Rmarkdown and trying to generate a table that has some conditional text formatting. The table comes out as what I want except for the color. It displays \textcolor{red}{50} for example instead of 50 in red. Any idea what I'm doing wrong?
In my R script:
table2 <- data %>% filter(student == 1) %>%
dplyr::mutate(grade = cell_spec(grade, "latex", color = ifelse(grade > 75, "blue", "red"))
In my Rmarkdown file:
```{r, results = "asis"}
kable(table2, format = "latex")
```