[R] Randomized Points in space/ saving model results

Rolf Turner rolf.turner at xtra.co.nz
Fri Oct 21 00:41:55 CEST 2011


On 21/10/11 06:32, magono wrote:
> A bit new to R and I'm working on something a bit more challenging than I am
> used to- so here's whats going on:
>
> Data inputs:  9 different shapefiles (.shp) of different point locations
> (lat, long)
>                     shapefile bounding box  (lat/long corner points (14, 1)
> (15,1) (14, 2) (15,2))
>                     1 .csv of lat/long coordinates for points
>
>
>
> Goal:  a- I want to randomly drop x number of points in a study area within
> the bounding box
>           b- Then I want to add the .csv points to the mix
>           c- Measure the distances from all these points to each of the 9
> shapefiles locations, one at a time and save the results in a table or list
>           d- run an regression analysis on the table or list created (I have
> this code all set to go)
>           e- I want to save the outputs of the model in a new table  (I have
> this code also)
>           f-  Run this whole process again x number of times and save x
> number of outputs in the table in order of creation
>
> Any help on steps a, b,c, or f would be appreciated.

I  believe that the tools available in the "spatstat" package would be of
use to you.  Read the vignette "Handling shapefiles in the spatstat 
package"
to find out how to convert shapefile objects to objects of classes with 
which
"spatstat" can deal.

     cheers,

         Rolf Turner



More information about the R-help mailing list