cd@@ek m@iii@g oii posteo@de
2020-Oct-02 12:27 UTC
[R] What is the threshold for `useRaster` of graphics::image()?
Hi R-help list What is the threshold for the `useRaster` argument of graphics::image() to decide whether a grid is "regular" or not (i.e. the usage of useRaster=T is allowed or not). My `dev.capabilities("rasterImage")$rasterImage` is "yes". I could not find this information in the internet. I also could not find the source code of the graphics::image() function (I would answer the question by myself then). Where can I find the source code? Thanks a lot for any help and kind regards, Chris packageDescription("graphics") Package: graphics Version: 4.0.2 Built: R 4.0.2; x86_64-pc-linux-gnu; 2020-06-22 08:33:40 UTC; unix [[alternative HTML version deleted]]
Bert Gunter
2020-Oct-02 18:59 UTC
[R] What is the threshold for `useRaster` of graphics::image()?
Clearly you need to spend some more time studying basic docs on how R works. R is open source: **all** code is available, though in different locations and with different means to access it. Typing:> graphics::imageat the console returns function (x, ...) UseMethod("image") <bytecode: 0x7f8d4ca1d448> <environment: namespace:graphics> This tells us that image() is an S3 method for the "image" generic (read the necessary docs if you don't know what this means).> methods("image")[1] image.default see '?methods' for accessing help and source code This tells us that there is only one method with the packages I have loaded in my session, image.default()> image.defaultnow gives the code: function (x = seq(0, 1, length.out = nrow(z)), y = seq(0, 1, length.out = ncol(z)), z, zlim = range(z[is.finite(z)]), xlim = range(x), ylim = range(y), col = hcl.colors(12, "YlOrRd", rev = TRUE), add = FALSE, xaxs = "i", yaxs = "i", xlab, ylab, breaks, oldstyle = FALSE, useRaster, ...) { ## many lines of code } which includes a call to C code "C_image" for which you would have to look elsewhere. The R Internals doc that ships with R tells you how to find that. Or just googling on "find C code in R" may give you more convenient options (e.g. through the pryr package). Cheers, Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Oct 2, 2020 at 11:28 AM <cdanek at posteo.de> wrote:> Hi R-help list > > What is the threshold for the `useRaster` argument of graphics::image() > to decide whether a grid is "regular" or not (i.e. the usage of > useRaster=T is allowed or not). My > `dev.capabilities("rasterImage")$rasterImage` is "yes". > > I could not find this information in the internet. I also could not find > the source code of the graphics::image() function (I would answer the > question by myself then). Where can I find the source code? > > Thanks a lot for any help and kind regards, > Chris > > packageDescription("graphics") > Package: graphics > Version: 4.0.2 > Built: R 4.0.2; x86_64-pc-linux-gnu; 2020-06-22 08:33:40 UTC; unix > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]