Superimpose density plots in R

4 messages Options
Embed this post
Permalink
Nikos Alexandris

Superimpose density plots in R

Reply Threaded More More options
Print post
Permalink
Hi all!

I started playing around with R and GRASS-maps.

I've a couple or raster maps (MODIS bands) in R and what I am trying to
achieve is to get density plots superimposed in one graph (for the sake
of easy visual comparison).

The only function that I have found and is able to perform this is
"sm.density.compare" ( belongs to the "sm" package). Although this
function works with *other* small (in terms of number of rows) examples,
for my MODIS bands (~87.000 rows each) I get an empty graph.

Any pointers for this "comparison" task?

Thank you, Nikos



_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Jarosław Jasiewicz

Re: Superimpose density plots in R

Reply Threaded More More options
Print post
Permalink
Nikos Alexandris pisze:

> Hi all!
>
> I started playing around with R and GRASS-maps.
>
> I've a couple or raster maps (MODIS bands) in R and what I am trying to
> achieve is to get density plots superimposed in one graph (for the sake
> of easy visual comparison).
>
> The only function that I have found and is able to perform this is
> "sm.density.compare" ( belongs to the "sm" package). Although this
> function works with *other* small (in terms of number of rows) examples,
> for my MODIS bands (~87.000 rows each) I get an empty graph.
>
> Any pointers for this "comparison" task?
>
> Thank you, Nikos
>
>
>
> _______________________________________________
> grass-stats mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-stats
>  
Hi
simply use density function with the same bandwith=, from=, to= for each
raster and next use lines to add curves for vuisual comparing

for example:
plot(density(bronze$a_slope,bw=0.1,from=0, to=12), col=2)
lines(density(neolitic$a_slope,bw=0.1,from=0, to=12), col=1)

Jarek
_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Nikos Alexandris

Re: Superimpose density plots in R

Reply Threaded More More options
Print post
Permalink
On Wed, 2009-01-28 at 12:03 +0100, Jasiewicz Jarosław wrote:
> Nikos Alexandris pisze:
> > I've a couple or raster maps (MODIS bands) in R and what I am trying to
> > achieve is to get density plots superimposed in one graph (for the sake
> > of easy visual comparison).
> > Any pointers for this "comparison" task?
   
> Hi
> simply use density function with the same bandwith=, from=, to= for each
> raster and next use lines to add curves for vuisual comparing

> for example:
> plot(density(bronze$a_slope,bw=0.1,from=0, to=12), col=2)
> lines(density(neolitic$a_slope,bw=0.1,from=0, to=12), col=1)
>
> Jarek

Thanks, of course it works :-). It is soooo easy :D
Cheers, Nikos

_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats
Dylan Beaudette

Re: Superimpose density plots in R

Reply Threaded More More options
Print post
Permalink
On Wednesday 28 January 2009, Nikos Alexandris wrote:

> On Wed, 2009-01-28 at 12:03 +0100, Jasiewicz Jarosław wrote:
> > Nikos Alexandris pisze:
> > > I've a couple or raster maps (MODIS bands) in R and what I am trying to
> > > achieve is to get density plots superimposed in one graph (for the sake
> > > of easy visual comparison).
> > > Any pointers for this "comparison" task?
> >
> > Hi
> > simply use density function with the same bandwith=, from=, to= for each
> > raster and next use lines to add curves for vuisual comparing
> >
> > for example:
> > plot(density(bronze$a_slope,bw=0.1,from=0, to=12), col=2)
> > lines(density(neolitic$a_slope,bw=0.1,from=0, to=12), col=1)
> >
> > Jarek
>
> Thanks, of course it works :-). It is soooo easy :D
> Cheers, Nikos
>
> _______________________________________________
> grass-stats mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-stats


library(lattice)
densityplot(~ value | group)

--
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341
_______________________________________________
grass-stats mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-stats