[AniMov] kernel UD

Clément Calenge calenge at biomserv.univ-lyon1.fr
Wed Jul 18 17:37:11 CEST 2007


Leslie Jones wrote:
> Thanks Clement - 
> And to export the 'res' values as ascii? What if you
> only want to export the values for the first animal in
> your code?
>   

Try:

export.asc(res[[1]], file="animal1.asc")

Hope this helps,

Clément.

>   
>> 2) In the past you have helped me with some code that estimates the
>> density values and then uses the udvol function to take the values 
>> contained
>> within the 95% contour.
>>  
>> udvol<-getvolumeUD(ud)
>> ## replaces the values upper than 95% with NA
>> gr <- lapply(gr, function(x) {x[x>95] <- NA;return(x)})
>>  
>> At this point, I would like to export the density values (not the 
>> volume values) contained within
>> the 95% contour. what is the easiest way of doing this?
>>     
>
> ## Estimate the UD and the volume
> data(puechabon)
> ud <- kernelUD(puechabon$locs[,c("X","Y")], puechabon$locs$Name)
> udvol <- getvolumeUD(ud)
>
> ## computes res
> res <- lapply(1:length(ud), function(i) {
>     uu <- ud[[i]]$UD
>     uu[udvol[[i]]$UD>95] <- NA
>     uu <- getascattr(ud[[i]]$UD,uu)
>     return(uu)
> })
>
> ## Displays the results
> par(mfrow=c(2,2), mar=c(0,0,0,0))
> lapply(res, function(x) {
>     image(x, axes=FALSE)
>     box()
> })
>
>
>
>
>
>
>
>   


-- 
Clément CALENGE
LBBE - UMR CNRS 5558 - Université Claude Bernard Lyon 1 - FRANCE
tel. (+33) 04.72.43.27.57
fax. (+33) 04.72.43.13.88




More information about the AniMov mailing list