sdm package

276 views
Skip to first unread message

rayan emad

unread,
Aug 12, 2015, 7:56:18 AM8/12/15
to Maxent
Dear all 
please just i try to practice with sdm package in R for Robert J. Hijmans and Jane Elith, when I try to apply this code ((backgr <- randomPoints(predictors, 500)) on my own data it is gave me this error (Error: could not find function "randomPoints") i download all package (ps, dismo, raster, library(maptools), but still i can run this code if any face this problem i hope he/she can help me.

regards

Emad

Ahmed El-Gabbas

unread,
Aug 12, 2015, 8:21:26 AM8/12/15
to Maxent
Dear Emad,

randomPoints function comes from the dismo package not sdm, so try loading the package first and re-run the function:
library(dismo)
(backgr <- randomPoints(predictors, 500)


# An example:
library(raster)
library(dismo)
f <- system.file("external/test.grd", package="raster")
r <- raster(f)
RP <- randomPoints(mask = r, n = 200)
plot(r)
points(RP)


Hope it works with you,
Cheers,
Ahmed
Reply all
Reply to author
Forward
0 new messages