Basj Basj - 1 year ago 67
R Question

Load an image in R, with no external package

Is it possible to load an image with R (.bmp or .jpg or .png or anything else), but without using an external package like this one :

> library(png)

Note: I don't want to require an external package, because it's for a course I'm teaching on university's computers where I think I cannot install package myself (and no time to ask sys-admin before the course...).

Thus, I'd like to load an image, but without having this error:

Error in library(png) : there is no package called ‘png’

because the package is not installed... This message was produced on my computer, showing that
seems to not be installed by default on Windows binaries

Answer Source

For future reference, here is a trick that allows to install packags on university computers that might have limited access:



x = readPNG('d:\\photo.png')
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download