[R-sig-Geo] random samples of a grid

Patrick Giraudoux patrick.giraudoux at univ-fcomte.fr
Fri Jan 5 13:01:08 CET 2007


Jeffrey,

You may want to have a look at the maptools and sp packages. maptools
has a readShapePoly() function which straightforward read polygon
shapefiles (equivalent exist for "points" , "lines", "grid", etc.), and
then you can use spsample() from the package sp.

sp and maptools combined provide extremely powerful tools for reading,
handling (see eg the function overlay()) and writing shapefiles. The
package rgdal even permit (among many other things) conversion between
projections!!!

To be somehow used to S4 objects may be an advantage since each object
once in R has a fixed structure organised with the concept of "slots"
whose avantage is to be completely transparent and whose drawback is a
relative level of complexity at first sight (but don't stay on this
impression: one can go through quite easy).

Patrick



>
> Date: Thu, 04 Jan 2007 20:49:06 -0600
> From: "Jeffrey Stratford" <stratja at auburn.edu>
> Subject: [R-sig-Geo] random samples of a grid
> To: <r-sig-geo at stat.math.ethz.ch>
> Message-ID: <459D6842020000F20001D91A at TMIA1.AUBURN.EDU>
> Content-Type: text/plain; charset=US-ASCII
>
> Hi,  is there a way to sample an ESRI grid using random sample points? 
> In the past I used ESRI's spatial analyst but I would like to switch all
> my analyses to R if possible.  The grid is from the National Land Cover
> Dataset  (30m res, 7 landcover classes).  I had roadside points from
> which I extracted data such as % grassland, % pine, etc in buffers of
> 90, 210, and 990 m radii.  I would like to generate 200 random samples
> from the same map to compare the roadside points to random samples (and,
> hopefully, there are no differences).   Make sense?  Hope so. 
>
> Thanks,
>
> Jeff
>
> ****************************************
> Jeffrey A. Stratford, Ph.D.
> Postdoctoral Associate
> 331 Funchess Hall
> Department of Biological Sciences
> Auburn University
> Auburn, AL 36849
> 334-329-9198
> FAX 334-844-9234
> http://www.auburn.edu/~stratja
>
>
>
> ------------------------------
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
> End of R-sig-Geo Digest, Vol 41, Issue 2
> ****************************************
>
>
>
>




More information about the R-sig-Geo mailing list