R Shiny - Error in as vector cannot coerce type externalptr to vector of type character

0 votes

I want to show a magick image object in r shiny app. When i try to display image using image_read(), it throws me below error.

Error in as.vector: cannot coerce type 'externalptr' to vector of type 'character'

Aug 14, 2019 in Data Analytics by ravin

1 answer to this question.

0 votes

Ravin, read the image into list src and then display using renderImage() to show image in shiny.

An example -

output$team_img = renderImage({ list(src = "C:\\Users\\admin\\Downloads\\teams.jpg", contentType = "image/jpeg")}) 

Now use ImageOutput() to display the image.

It's better to create a folder names www and save the image within the directory.

answered Aug 19, 2019 by anonymous
• 32,910 points