kableExtra
kableExtra copied to clipboard
Cannot make images appear on cells
Dear all, I am trying to get an icon to appear on a table with no avail. I have tried different approaches, like providing the full path to the PNG icon, also placing the icon on same directory as the R script, etc. No matter what, I can only get the 'image not found' icon
# I am using same example as in the manual
tbl_img <- data.frame(
name = c("kableExtra 1", "kableExtra 2"),
logo = ""
)
tbl_img %>%
kbl(booktabs = T) %>%
kable_paper(full_width = F) %>%
column_spec(2, image = "kableExtra_sm.png")
The icon was initially placed on another directory as follows
# I am using same example as in the manual
tbl_img <- data.frame(
name = c("kableExtra 1", "kableExtra 2"),
logo = ""
)
tbl_img %>%
kbl(booktabs = T) %>%
kable_paper(full_width = F) %>%
column_spec(2, image = "/Users/myself/Documents/project A/_icons/kableExtra_sm.png")
As this did not work, I tried to place it directly under same folder as the calling script, but did not work either. Any suggestions on what could be happening?
Many thanks