[AniMov] burst function in liker and kernelbb

Andrea Maxie andrea.maxie at gmail.com
Wed Jan 21 23:36:24 CET 2009


I am trying to use the burst function to create Brownian bridge home ranges
based on time of day (day and night).  I have posted a sample of the R
command script and output below to help illustrate my issue.  I have
numbered each day (or night – I have separated days and nights into separate
files for each animal) with a unique, consecutive value.   

When running the script, I get the error “Error in plot.new() : figure
margins too large” after the Liker function, presumably because a plot is
created for each Sig1 function.  By setting ‘plotit’ to FALSE in the Liker
function I could move past that point, but it continues to be a problem when
plotting the kernelbb, which in turn causes problems with outputting (see
sample output below sample script).  

I tried using a small number of bursts (3) with success, but still have
problems when using many bursts.  When using three bursts, only one plot is
created, so I am unsure why increasing the number of bursts should create a
figure margin problem.

I would very much appreciate any insight anyone can offer.

Andrea

Andrea Maxie
M.Sc. Candidate
Environmental & Life Sciences Graduate Program
Trent University
Peterborough, Ontario



Sample BBMM script using the burst function:

data<-read.csv("data.csv")
data[1:10,]
x<-data$x
y<-data$y
xy<-cbind(x,y)
datetime<-data$datetime
id<-data$id
brst<-data$burst
da<-as.POSIXct(strptime(as.character(data$datetime), tz="GMT", "%d/%m/%Y
%T"))
trj<-as.ltraj(xy, da, id, burst=brst, typeII=T, slsp="remove")
sig2<-data$error
liker(trj, sig2, byburst=T, rangesig1=c(0, 30))

xybox <- data.frame(x=c(min(na.omit(data$x))-2500,
max(na.omit(data$x))+2500), 
                        y=c(min(na.omit(data$y))-2500,
max(na.omit(data$y))+2500)) 
asc <- ascgen(xybox, cellsize=25) 

bb<-kernelbb(trj, sig1=1.8619, sig2, byburst=T,grid=asc)
save(bb, file="test.rdata")
image(bb[[1]]$UD)
contour(getvolumeUD(bb)[[1]]$UD, level=99, add=T, col="red", lwd=2)
udvol<-getvolumeUD(bb)
export.asc(udvol[[1]]$UD, "test3b.asc")
ver99<-getverticeshr(bb, lev=99)
sh99<-kver2shapefile(ver99, which=names(ver99))
write.shapefile(sh99,"test3b_ctr99")
rm(list=ls(all=TRUE))

Sample output:

> bb<-kernelbb(trj, sig1=1.8619, sig2, byburst=T,grid=asc)
> save(bb, file="test3b.rdata")
> image(bb[[1]]$UD)
Error in plot.new() : figure margins too large
> contour(getvolumeUD(bb)[[1]]$UD, level=99, add=T, col="red", lwd=2)
Error: NA/NaN/Inf in foreign function call (arg 1)
> 
> udvol<-getvolumeUD(bb)
Error: NA/NaN/Inf in foreign function call (arg 1)
> export.asc(udvol[[1]]$UD, "test3b.asc")
Error in inherits(x, "asc") : object "udvol" not found
> 
> ver99<-getverticeshr(bb, lev=99)
Error: NA/NaN/Inf in foreign function call (arg 1)
> sh99<-kver2shapefile(ver99, which=names(ver99))
Error in inherits(kv, "kver") : object "ver99" not found
> write.shapefile(sh99,"test3b_ctr99")
Error in is.vector(object) : object "sh99" not found
 

-- 
View this message in context: http://www.nabble.com/burst-function-in-liker-and-kernelbb-tp21593626p21593626.html
Sent from the AniMov mailing list archive at Nabble.com.



More information about the AniMov mailing list