[STATSGRASS] correlation matrix

Carlos "Guâno" Grohmann carlos.grohmann at gmail.com
Wed Jun 27 11:18:28 EDT 2007


thanks!



On 6/27/07, Roger Bivand <Roger.Bivand at nhh.no> wrote:
>
> On Wed, 27 Jun 2007, Carlos "Guâno" Grohmann wrote:
>
> > Hello, I'd like to make some correlation matrix for raster maps in R.
> > I tried to
> >>  map1<-readRAST6("lageado_10k_fisher_K_15x15")
> >>  map2<-readRAST6("lageado_10k_fisher_K_25x25")
> >>  cor(map1,map2)
> > Error: is.atomic(y) is not TRUE
> >
> > What is my mistake? I can' make cor() with SpatialGridDataFrame?
> > Can I make it with several maps at once?
>
> The imported objects are *not* vectors, but SpatialGridDataFrames. Can I
> suggest:
>
> map <- readRAST6(c("lageado_10k_fisher_K_15x15",
>    "lageado_10k_fisher_K_25x25"))
> summary(map)
> cor(as(map, "data.frame"))
>
> Roger
>
> >
> > BTW, the maps have the same size, resolution, etc.
> > thanks
> >
> > Carlos
> >
> >
> >
>
> --
> Roger Bivand
> Economic Geography Section, Department of Economics, Norwegian School of
> Economics and Business Administration, Helleveien 30, N-5045 Bergen,
> Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
> e-mail: Roger.Bivand at nhh.no
>



-- 
+-----------------------------------------------------------+
              Carlos Henrique Grohmann - Guano
  Visiting Researcher at Kingston University London - UK
  Geologist M.Sc  - Doctorate Student at IGc-USP - Brazil
Linux User #89721  - carlos dot grohmann at gmail dot com
+-----------------------------------------------------------+
_________________
"Good morning, doctors. I have taken the liberty of removing Windows 95 from
my hard drive."
--The winning entry in a "What were HAL's first words" contest judged by
2001: A SPACE ODYSSEY creator Arthur C. Clarke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-stats/attachments/20070627/5c6d0e61/attachment.html


More information about the grass-stats mailing list