[R] Reading graphics files
drf5n@mug.sys.virginia.edu
drf5n at mug.sys.virginia.edu
Wed Jun 25 16:14:58 CEST 2003
On Tue, 24 Jun 2003, Roger Bivand wrote:
...
>
> library(pixmap), perhaps? Reads PNM (so PPM, PGM, PBM).
>
Thanks! This is precisely what I was looking for. I had gotten to the
point of:
> con<-file("image.ppm",open="rb")
> readLines(con,n=3)
[1] "P6" "600 400" "255"
> zz<-readBin(con,size=1,n=3*600*400,what='int')
> close(con)
> dim(zz)<-c(3,600,400)
> image(1:600,1:400,zz[1,,400:1])
... and then realized that the coordinates and colormaps would be awkward.
Thanks to Frederich Leisch and Roger Bivand for writing the CRAN pixmap
package. Would a pointer to it in the see-also sections of 'bitmap',
'png', and 'image' be appropriate?
Thanks again,
Dave
--
Dave Forrest (434)924-3954w(111B) (804)642-0662h (804)695-2026p
drf5n at maplepark.com http://mug.sys.virginia.edu/~drf5n/
More information about the R-help
mailing list