I have a footnote in a table formatted with kable and kableExtra for an Rmarkdown-generated pdf. I need NYC to have the superscript (NYC^1
) to point to the footnote, but can't figure out how to do it. Any suggestions?
df <- data.frame(city=c("NYC","LA","CHI","MIA"),
score=sample(1:100, 4, replace=T))
library(kableExtra)
library(kable)
kable(df,
digits = 2,
format = "latex",
align="c",
row.names = FALSE,
booktabs=T) %>%
kable_styling(bootstrap_options = c("hover"),
full_width = F,
font_size = 12,
position = "left") %>%
footnote(number = c("2017 data missing"))
NYC
with"NYC^1^"
when creating the df, but only if I remove the format="latex") from the kable call. Unfortunately, that means I also can't use the kable_styling. I tried usingdf[1,1]<-"NYC\\textsubscript{1}"
but no luck. – – Emilio M. Bruna