Open RS-eco opened 3 years ago
Hi,
I was about to report the same issue. Now that @RS-eco mentions the matrix conversion, I found that the function seems to work properly if we disable the line input.matrix <- input.matrix[complete.cases(input.matrix),]
, to keep all NAs in their places. But I'm not sure what it's really doing with the NA pixels, as they are not NA and have different values in the resulting raster maps.
Also, there seems to be a disagreement in the name of the function (plot_mcmc.R
, but plot.mcmc <- function {...}
inside).
Otherwise it seems to work, thanks Colin for another great function!
Thanks, yes disabling the specified line works.
If you additionally mask the output raster before plotting, add r <- mask(r, inputstack[[1]])
after creating the object "r", there should also be no problem with the NAs in the resulting maps.
I'm also getting an issue with plot.mcmc both in the vignette and in my own project. I get the following error for all lines using it:
Error in plot.mcm(sdm.tiny, climate, iter = 100) : could not find function "plot.mcm"
I tried
embarcadero::plot.mcmc(sdm, climate, iter=5, quiet = TRUE)
as well, but that results in an error
Error: 'plot.mcmc' is not an exported object from 'namespace:embarcadero'
Was this function removed from the package?
The plot.mcmc() function works fine for the example provided, but if the raster input dataset is not a simulated squared-raster layer but a masked raster layer (i.e. South America) the output of the plot.mcmc() function is meaningless. I probably has something to do with the matrix conversion in the beginning of the function. Here is a reproducible example of the problem: