Recently, I updated R and RStudio, and I encountered a problem regarding the combination of Hebrew inside GT tables. The problem only occurs when I generate a markdown file. I read all kinds of similar issues, but I couldn't find anything that worked for me.
The scenario is as follows:
I can create the table on my console and it will show up correctly in the RStudio viewer.
The following is a repex code for creating a table in my weird little language:
library(gt)
library(tidyverse)
Name <- c("בן", "דנה", "דג", "בוריס", "נומי")
Age <- c(23, 41, 32, 58, 26)
df <- data.frame(Name, Age)
table<- df %>%
gt()
table
it suppose to look like this:
When I combine the table inside a rmd file it will messed up looks like in the picture bellow.
As you can see, the title and the text below the table looks fine.
Here is the code for rmarkdown, I hope you'll be able to reproduce the issue.
Thank you!
---
title: "כותרת"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(gt)
library(tidyverse)
Name <- c("בן", "דנה", "דג", "בוריס", "נומי")
Age <- c(23, 41, 32, 58, 26)
df <- data.frame(Name, Age)
table<- df %>%
gt()
```
```{r table, echo=FALSE}
table
```
<div> טקסט שכן עובד בעברית</div>
```