Julie,
My understanding is that the bias-file is used to sample the "background"
with the same bias as your survey data (for multiple species). What you can
do is do your own background sampling and provide that sample to
dismo::maxent as background points. You could make a binary mask and use
the randomPoints function. Alternatively use the sample function with a
prob=...  argument where you sample from the relevant cell numbers and the
prob is the weight for that cell (high if it was a collection site for
other species).
Robert


On Wed, Mar 13, 2013 at 1:58 PM, Julie Lee-Yaw <julleeyaw@yahoo.ca> wrote:

> Hi All,
>
> Does anyone know how to incorporate a biasfile into a maxent run set up
> from the R package dismo?
>
> Or is it even possible to run dismo's maxent command with a bias file?
>
> Here's what I've tried:
>
> mybias<-raster(file.choose())  # load bias grid of same extent and
> resolution as raster layers
>
> ## Attempt 1
> test1<-maxent(rasters,localities,removeDuplicates=TRUE,
> args="biasfile=mybias")
>
> # Result
> Error in file(con, "r") : cannot open the connection
> In addition: Warning message:
> In file(con, "r") :
>   cannot open file
> '/var/folders/rm/kftt7_jj5h70d5kgypw6njwr0000gn/T/R_raster_tmp/maxent/
> 7322841707/species.lambdas': No such file or directory
>
> ## Attempt 2
> test2<-maxent(rasters,localities,removeDuplicates=TRUE,
> args="biasfile=/Users/Documents/mybias.asc") # use path name instead
>
> # Result
> Error in file(con, "r") : cannot open the connection
> In addition: Warning message:
> In file(con, "r") :
>   cannot open file
> '/var/folders/rm/kftt7_jj5h70d5kgypw6njwr0000gn/T/R_raster_tmp/maxent/02810774444/species.lambdas':
> No such file or directory
>
>
> ## Attempt 3
>
> test4<-maxent(rasters,localities,removeDuplicates=TRUE, biasfile=mybias)
>
> # This runs but the bias file seems to be ignored. That is, the bias file
> isn't listed as a parameter in the html file of the results (when running
> maxent directly the output html file mentions the bias file under the "Raw
> data output and control parameters" section)
>
> Thanks!
>
> Julie
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

