[GRASS-stats] Scatterplot "thinning" (points reduction)?

Dylan Beaudette dylan.beaudette at gmail.com
Sun Aug 16 14:02:56 EDT 2009


Hi Markus,

Can you sample the original maps with v.random + v.what.rast first?
Or, after reading in the raster data into R, only compare every nth
cell? You can generate a sequence to index every nth cell like this:

s <- seq(from=1, to=n, by=10)

Then, subset your spatial data frame like this:

spdf[s,]

Another approach would be to use a density estimate in parameter space:

library(MASS)
x <- rnorm(1000)
y <- rnorm(1000)
dd <- kde2d(x,y)
contour(dd)
persp(dd, theta=-30, phi=30, d=5)
image(dd)


Cheers,

Dylan

On Sun, Aug 16, 2009 at 10:45 AM, Markus Neteler<neteler at osgeo.org> wrote:
> Hi,
>
> I am plotting elevation against temperature and have the problem that
> including all points leads to heavy slow graphs... Reducing the raster
> resolution is not a solution since it does not maintain the characteristics
> of the graph (since GRASS is using nearest neighbor).
>
> Since I am plotting in many cases one point almost over the other
> a reduction should be reasonable - question is how to do that?
>
> I am speaking about 3 plots in one graph, say "original", "interim"
> and "final" (so, one plot() and two points()).
>
> Any advice welcome,
> Markus
> _______________________________________________
> grass-stats mailing list
> grass-stats at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-stats
>


More information about the grass-stats mailing list