Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'sa' argument in 'MPG' doesn't work as expected #23

Closed
achubaty opened this issue Oct 20, 2016 · 2 comments
Closed

'sa' argument in 'MPG' doesn't work as expected #23

achubaty opened this issue Oct 20, 2016 · 2 comments
Assignees

Comments

@achubaty
Copy link
Owner

from the example in MPG():

library(igraph)
library(raster)

tiny <- raster(system.file("extdata/tiny.asc", package = "grainscape"))
tinyCost <- reclassify(tiny, rcl = cbind(c(1, 2, 3, 4), c(1, 5, 10, 12)))
tinyPatchMPG <- MPG(cost = tinyCost, patch = (tinyCost == 1))
plot(tinyPatchMPG, col = c("grey", "black"), legend = FALSE)

## Produce a patch-based MPG with a study area consisting of half of the map
tinySa <- tinyCost
tinySa[] <- 1
tinySa[1:5000] <- 0
tinySaMPG <- MPG(cost = tinyCost, patch = (tinyCost == 1), sa = tinySa)
plot(tinySaMPG)

Without looking more closely, this may simply be an issue with how the mpgPlot is being created, rather than an issue with the mpg itself.

@ecologics
Copy link
Collaborator

I think we should remove the sa argument. Andrew Fall's code allowed the user to specify an SA because cropping maps was not as straightforward 15 years ago as it is now. Sam's code didn't include this, I presume. So I say remove the argument and let users pre-crop if they think it is necessary.

@achubaty
Copy link
Owner Author

works for me. it's an easy removal, and trivial for the user to pre-crop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants