When creating tables using kable
, is there a way to generate a line break (ie < br >
) when string in a data.frame 'dt'
has \n
?
For example, here:
library(data.table);
dt <- fread("https://s3.amazonaws.com/assets.datacamp.com/blog_assets/prince_raw_data.csv")
dt <- dt[301:303,2:6] #take three songs only
library(knitr); library(kableExtra)
kable(dt);
# use this line to view it: dt %>% kable %>% kable_styling()
This relates to Automated nicely formated book of lyrics from data.frame using markdown, knitr and glue: