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 in Data Analytics by ravin
21 views

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 6 days ago by anonymous
• 21,470 points