On 7 Aug 2003, Tito de Morais Luis wrote: > Dear listers, > > I loaded a pixmap image with: > brobo <- read.pnm("brobo.pnm") > > I can have the characteristics of the image with: > > brobo > Pixmap image > Type : pixmapRGB > Size : 609x682 > Resolution : 1x1 > Bounding box : 0 0 682 609 > > How can I retrieve the image size ? > nrow(brobo) and ncol(brobo) give NULL
> getClass("pixmap") Slots: Name: size cellres bbox bbcent Class: integer numeric numeric logical Known Subclasses: "pixmapChannels", "pixmapIndexed", "pixmapGrey", "pixmapRGB" [EMAIL PROTECTED], to get the equivalent of dim(), nrow is [EMAIL PROTECTED], ncol [EMAIL PROTECTED], or: setGeneric("nrow", function(x) standardGeneric("nrow")) setMethod("nrow", "pixmap", function(x) { [EMAIL PROTECTED] }) gets you there. Roger > > I succeeded using: > > > nrow(getChannels(brobo)) > [1] 609 > > ncol(getChannels(brobo)) > [1] 682 > > It looks a bit tricky, is there another way ? > > Thanks in advance, > > Tito > > Running Mandrake 9.1 > > > version > _ > platform i686-pc-linux-gnu > arch i686 > os linux-gnu > system i686, linux-gnu > status > major 1 > minor 7.1 > year 2003 > month 06 > day 16 > language R > > > -- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Breiviksveien 40, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93 e-mail: [EMAIL PROTECTED] ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help