Well, the problem you are facing is that you are not using the boot
function as the documentation you are accessing. From ?boot
can see that the second argument is statistic
:
A function that, when applied to data, returns a vector containing statistical data. When sim = "parametric", the first argument to statistics should be data. For each replicated simulation dataset, the returned ran.gen will be transmitted. In all other cases, statistics should take at least two arguments. The first argument passed will always be raw data. The second will be a vector of indices, frequencies or weights that define the bootstrap pattern.
Note that this means that your function must be defined to accept at least two arguments. Yours accepts only one (and then ignores it completely, oddly enough).
The idea is that you pass in the raw data and the pointer vector. Then you calculate your percentage statistics by a subset of the source data using these guidelines, which will make up the “bootstrapping sample”.
So instead:
kUDoct<-function(i) kernel.area(oct[,5:6],oct[,10],kern="bivnorm",unin=c("m"),unout=c("km2")) bootoct<-boot(oct,kUDoct,R=1000)
You probably want to do something more:
kUDoct<-function(dat,ind) kernel.area(dat[ind,5:6],dat[ind,10],kern="bivnorm",unin=c("m"),unout=c("km2")) bootoct<-boot(oct,kUDoct,R=1000)
But I can’t diagnose any other errors you might get, as your example is not fully reproducible.