Just 2k may mean 4 million rectangles. R display is vector, hard-copy, with
some recent support for raster grids when the rectangles are in fact square.
As has been said, the graphics engine is not designed for fast screen
output, but for scientific statistical graphics. 

spplot uses lattice graphics, which are slower anyway, but analytically more
powerful. For me running levelplot() - the internals of spplot - on a 2k by
2k matrix takes 2 seconds, but output to a png file using cairo takes 70
seconds. 

Using the improved raster graphics handling for square cells with image()
rather than spplot() and useRaster=TRUE - equivalent to
image.SpatialGridDataFrame() and useRasterImage=TRUE with the same matrix
takes 1.2 seconds on x11/cairo. You didn't say which version of R you are
using - the raster graphics facilities have been improved recently.

Did you try using image() instead of spplot() if your cells are square, and
if rasterImage() is available in your version of R?

Roger


Paolo Cavallini wrote
> 
> Il 22/02/2012 12:21, Benjamin Ducke ha scritto:
>> As opposed to GRASS, R has not been designed
>> with computational and/or memory efficiency as a priority.
> Oh! I was not fully aware of this.
>> Maybe your analysis would allow you to run your
>> computations on a representative sample instead
>> of the whole dataset?
> In our case, the "analysis" is vert simple: just ssplot() of a small (2k 
> by 2k cells) raster.
> Thanks.
> 
> -- 
> Paolo Cavallini
> See: http://www.faunalia.it/pc
> 
> _______________________________________________
> grass-user mailing list
> grass-user@.osgeo
> http://lists.osgeo.org/mailman/listinfo/grass-user
> 


--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/spgrass6-tp4494142p4495201.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to