title: How do i create graphs and images to show on the same panel in R
body: <p>I'm new to R and trying to show graphs and images on the same page with R.
  I tried to use <code>library(ggpubr)</code> and <code>ggarrange()</code> function.</p>
  
  <p>to import the images I used <code>library(png)</code> and <code>readPNG()</code> to import my images.</p>
  
  <p>The end result i'm aiming for is something like this:</p>
  
  <p><img src="https://i.stack.imgur.com/tzXfA.png" alt="enter image description here"> </p>
  
  <p>The code i used to create the panel is:</p>
  
  <pre><code>library(ggpubr)
  library(png)
  
  data("ToothGrowth")
  
  bxp &lt;- ggboxplot(ToothGrowth, x = "dose", y = "len",
                   color = "dose", palette = "jco")
  dp &lt;- ggdotplot(ToothGrowth, x = "dose", y = "len",
                  color = "dose", palette = "jco", binwidth = 1)
  
  img1 &lt;- readPNG("image1.png")
  img2 &lt;- readPNG("image2.png")
  
  im_A &lt;- ggplot() + background_image(img1) # tried to insert the image as background.. there must be a better way
  im_B &lt;- ggplot() + background_image(img2) 
  
  ggarrange(im_A, im_B, dp, bxp, 
            labels = c("A", "B", "C", "D"),
            ncol = 2, nrow = 2)
  </code></pre>
  
  <p>of curse i inserted the images manually using power-point.</p>
  
  <p>Thanks,</p>