Closed oharar closed 5 months ago
Hi Bob,
The datasetName
argument needs to be a character of one of the dataset's names added in intModel
. I'll change some of the documentation and add some more defences to ensure that that is the case before it hits that error.
Ah, that works! :-)
I just got this error:
The problem is that PA.spat is a data frame, and on l1065 of dataSDM.R the test is:
if (length(datasetName) != 1) stop ('Please only provide one dataset name.')
I think the solutiuon is to use sys.call() From
Z <- 1:10 tmpfun <- function(x,y,z,...) { length(as.list( sys.call() )$z) } tmpfun( x=5, w=3, z=Z )
(adapted from Greg Snow's explanation here: https://stat.ethz.ch/pipermail/r-help/2011-September/288786.html)
Without testing, I think this should work: if (length(as.list(sys.call())$datasetName) != 1) stop ('Please only provide one dataset name.')
which does look ugly