-2

I wanna import a png image onto RStudio and visualize it in the Plots tab as it is a standard R graphical output. Any ideas?

Tnx

Dag

Mister Dag
  • 31
  • 1
  • 1
  • 2
  • 6
    What have you already tried? Where did you get stuck? _Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself_. Please see: [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). – Eric Fail Jan 19 '16 at 17:01
  • 1
    Did you look at the png package and readPNG function? – lawyeR Jan 19 '16 at 18:23

1 Answers1

1

To load and visualize image files in R you can use the readImage() and display() functions from EBImage:

library(EBImage)

img = readImage("path/to/your/image/file or URL")
display(img, method = "raster")

Cheers,

Andrzej

aoles
  • 1,525
  • 10
  • 17