Skip to content Skip to sidebar Skip to footer

R: Error In As.vector(x, "character"): Cannot Coerce Type 'externalptr' To Vector Of Type 'character'

I am using the R programming language. I am trying to combine a HTML file and a JPG Image file together. My code looks something like this: library(plotly) library(shiny) library(m

Solution 1:

Maybe you can put this in R Markdown and knit it as HTML to get the output in one HTML file.

---
title: "temp"
output: html_document
---


```{r, echo=FALSE, warning=FALSE, message=FALSE}
library(plotly)
library(shiny)
library(magick)


widget_1 = plot_ly(iris, x = ~Sepal.Length, type = "histogram", nbinsx = 20)

#upload some jpg image from your computer into R
my_image = image_read("try.png")
```

```{r, echo=FALSE, warning=FALSE, message=FALSE, fig.height=3}
widget_1
```

```{r, echo=FALSE, warning=FALSE, message=FALSE, out.width = "600px"}
my_image
```

This generates HTML file as :

enter image description here


Post a Comment for "R: Error In As.vector(x, "character"): Cannot Coerce Type 'externalptr' To Vector Of Type 'character'"