[R-sig-Geo] R-sig-Geo Digest, Vol 138, Issue 4

Karloz cafpx at hotmail.com
Fri Feb 6 17:03:48 CET 2015



r-sig-geo-request at r-project.org wrote:

>Send R-sig-Geo mailing list submissions to
>	r-sig-geo at r-project.org
>
>To subscribe or unsubscribe via the World Wide Web, visit
>	https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>or, via email, send a message with subject or body 'help' to
>	r-sig-geo-request at r-project.org
>
>You can reach the person managing the list at
>	r-sig-geo-owner at r-project.org
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of R-sig-Geo digest..."
>
>
>Today's Topics:
>
>   1. Re: grid in adehabitatHR (chirleu)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Tue, 3 Feb 2015 07:37:27 -0700 (MST)
>From: chirleu <chirleu at gmail.com>
>To: r-sig-geo at r-project.org
>Subject: Re: [R-sig-Geo] grid in adehabitatHR
>Message-ID:
>	<CALC46t_qMTRveZJvRCFxFb+FeU1hVrK21Cyphgm_2hXTYMkmFQ at mail.gmail.com>
>Content-Type: text/plain; charset=us-ascii
>
>Hi Jed,
>It worked! So thank you. I was close. I think I was passing a complet grid
>(not only 4 points):
>loc4=raster(loc,nrows=1000,ncols=1000)
>but for some reason did not work. It seems the key is the expand.grid
>function.
>
>Cheers,
>
>David
>
>2015-02-03 10:52 GMT+01:00 JLong [via R-sig-geo] <
>ml-node+s2731867n7587727h27 at n2.nabble.com>:
>
>> Hi David,
>>
>> The kernelUD 'grid' parameter expects a SpatialPixels object that
>> represents the raster upon which you wish to estimate the animal UD. You
>> are passing in only a raster with 4 pixels, which I think represent the
>> outer corners of the raster upon which you wish to estimate the UD.
>> Alternatively, the grid parameter can accept a number that represents the
>> pixel size, and it will automatically build the raster for you.
>>
>> The problem lies in your buildup definition of the SpatialPixelsDataFrame
>> object. When you define a 'grid' you need to identify the locations of each
>> pixel in the grid and save those as columns x  and y  in the data frame.
>> See the 'expand.grid' function and the meuse.grid example in the function
>> 'coordinates'.
>>
>> As a test just try:
>> kud=kernelUD(detections[,1],h=h, grid=40, kern=c("bivnorm"))
>>
>>
>> Then, the process if you wish to define your own grid would then be:
>> x <- seq(xmin,xmax,by=resolution)  # where resolution is the pixel size
>> you desire
>> y <- seq(ymin,ymax,by=resolution)
>> xy <- expand.grid(x=x,y=y)
>> coordinates(xy) <- ~x+y
>> gridded(xy) <- TRUE
>> class(xy)
>>
>> kud=kernelUD(detections[,1],h=h, grid=xy, kern=c("bivnorm"))
>>
>> Cheers,
>> Jed
>>  Jed Long
>> Lecturer in GeoInformatics
>> Department of Geography & Sustainable Development
>> University of St Andrews, UK
>>
>>
>> ------------------------------
>>  If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://r-sig-geo.2731867.n2.nabble.com/grid-in-adehabitatHR-tp7587722p7587727.html
>>  To unsubscribe from grid in adehabitatHR, click here
>> <http://r-sig-geo.2731867.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=7587722&code=Y2hpcmxldUBnbWFpbC5jb218NzU4NzcyMnw3MzA1Njc5Nw==>
>> .
>> NAML
>> <http://r-sig-geo.2731867.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
>
>--
>View this message in context: http://r-sig-geo.2731867.n2.nabble.com/grid-in-adehabitatHR-tp7587722p7587728.html
>Sent from the R-sig-geo mailing list archive at Nabble.com.
>
>
>
>------------------------------
>
>Subject: Digest Footer
>
>_______________________________________________
>R-sig-Geo mailing list
>R-sig-Geo at r-project.org
>https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
>------------------------------
>
>End of R-sig-Geo Digest, Vol 138, Issue 4
>*****************************************
>


More information about the R-sig-Geo mailing list