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

Create problem formulation, feature requires raster #9

Closed
ricschuster opened this issue Mar 29, 2017 · 2 comments
Closed

Create problem formulation, feature requires raster #9

ricschuster opened this issue Mar 29, 2017 · 2 comments

Comments

@ricschuster
Copy link
Member

It seems to me that both the 'standard'

problem(x, features, ...)

function as well as the marxan_problem function require the features to be supplied as rasters.

The initial idea for the marxan_problem function was this:

p <-marxan_problem(pu_polygons, cost=..., features=..., locked_in=..., 
  locked_out=..., penalty=..., edge_factor=....)

where the dots are column names or vectors of values.

I think it would be great to allow for the latter case.

Along the same lines, I think it would also be good if in the standard 'problem' function we would allow to mix spatialdataframe classes with dataframes (as features). That's the way I often use shapfefiles and csv files together. Not sure how common it is, but I would imagine its fairly common.

@jeffreyhanson, how is your availability in the next little while? Do you still have time to tackle these things or do you need to focus on finishing your PhD?

@jeffreyhanson
Copy link
Contributor

Yeah, I didn't get around to doing that.

To implement this, we could add the following method to problem:

p <- problem(cost, features, cost_name)

where cost is a SpatialPolygonsDataFrame class, cost_name is a character specifying the column name with cost, and features is a character vector specifying the column names with the feature abundances. So that users can specify the problem data using just a SpatialPolygonsDataFrame.

We would probably have to switch problem to S4 though, since S3 won't allow dispatch on multiple arguments.

After adding this functionality, it would be pretty straight forward to add a new method to the marxan_problem that does what you want.

I don't really have the time at the moment to work on this. I might be able to find some spare time in the next few weeks, but I can't make any promises.

@ricschuster
Copy link
Member Author

Thanks Jeff. I can try to work this out. Will be good practice for me anyways.
In case you do get a chance to look at this, please let me know so we don't overlap in our efforts.

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