| read.bitmap {readbitmap} | R Documentation |
By default uses magic byte to identify file (rather than the file extension) Currently uses readers in bmp, jpeg and png packages.
read.bitmap(f, channel, IdentifyByExtension = FALSE, ...)
f |
Path to image file |
channel |
Integer identifying channel to return for an RGB image |
IdentifyByExtension |
Identify by file extension only (Default FALSE) |
... |
Additional parameters passed to underlying image readers |
return value
img1=read.bitmap(system.file("img", "Rlogo.jpg", package="jpeg"))
str(img1)
img2 <- read.bitmap(system.file("img", "Rlogo.png", package="png"))
# nb the PNG image has an alpha channel
str(img2)