excelR
excelR copied to clipboard
can't see the picture in the table
hello I want to use "excelR" to directly show some picture in the table. my image is stored in my computer. here is my code:
data <- data.frame(Title = c("A", "B"),
Cover = c("C:/Users/JZHA/test3.jpg","C:/Users/JZHA/IMG_0006.JPG"))
columns <- data.frame(title = colnames(data),
type = c("text", "image")
)
excelTable(data = data, columns = columns)
the example code in "https://swechhya.github.io/excelR/index.html" works fine to me the only difference is the path of the images. Does anyone know why this happen?
@zhangjunjiang try the following:
Cover = c(base64enc::dataURI(file="C:/Users/JZHA/test3.jpg", mime="image/jpeg", encoding="base64"),
base64enc::dataURI(file="C:/Users/JZHA/IMG_0006.JPG", mime="image/jpeg", encoding="base64")
)
Typically, I work with SVG images (not jpg); if this doesn't work: check the mime type