[R-sig-Geo] [FORGED] spsample: defining the size of the cell in an hexagonal grid

Manuel Spínola mspinola10 at gmail.com
Thu Mar 2 14:01:34 CET 2017


Thank you very much Rolf.

Manuel

2017-03-01 2:03 GMT-06:00 Rolf Turner <r.turner at auckland.ac.nz>:

> On 01/03/17 17:33, Manuel Spínola wrote:
>
>> Dear list members,
>>
>> How can I define the size in hectares of the cell when doingan hexagonal
>> grid with the function spsample.  What it means "cellsize"?  I want to
>> create cell sizes according to some specific number of hectares.  How can
>> I
>> do it?
>>
>>
>> data(meuse.grid)
>> gridded(meuse.grid) = ~x+y
>> plot(meuse.grid)
>> HexPts <-spsample(meuse.grid, type="hexagonal", cellsize=1000)
>> HexPols <- HexPoints2SpatialPolygons(HexPts)
>> plot(HexPols[meuse.grid,], add=TRUE)
>>
>
>
> I have no knowledge of spsample() nor of its argument cellsize (doesn't
> the help for spsample() tell you what this argument means?) but it might be
> useful for you to realise (if you are not already aware of this) that the
> area of a regular hexagon is
>
>     A = 3*sqrt(3)*s^2/2
>
> where s is the length of side of the hexagon.  So if you want hexagons of
> area 42 hectares you would take their sides to be of length 402.0673 metres.
>
> cheers,
>
> Rolf Turner
>
> --
> Technical Editor ANZJS
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspinola at una.cr <mspinola at una.ac.cr>
mspinola10 at gmail.com
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list