Giter Site home page Giter Site logo

Comments (9)

ricschuster avatar ricschuster commented on May 21, 2024

from prioritizr.

jeffreyhanson avatar jeffreyhanson commented on May 21, 2024

The pre_prioritizr app looks great!

Yeah that sounds good. If I understand correctly, the pre_prioritizr app assumes users have the marxan data already compiled in a shapefile. We could definitely accommodate input like this with no problem.

We could have an R function that creates a marxan problem like 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. This returns a standard ConservationProblem object that would be the same as if the users did:

p <- problem(pu_polygons, features=c(......)) %>%
     add_minimum_set_objective(cost='cost') %>%
     add_locked_in('locked_in') %>%
     add_locked_out('locked_out') %>%
    add_boundary_constraint(penalty=.., edge_factor=...)

We could create a load_planning_data (idea for better name?) function that opens a shiny app that is essentially a wrapper for the marxan_problem function to help users import data.

After ingesting the data and setting some initial parameters, they could run the modify function that is the standard shiny interface for visualising solutions and playing around with settings.

p2 <- modify(p)

How does that sound?

My concern is how we should handle raw marxan input data. In this case, the data doesn't have a spatial component and so doing modify(p) to play around with different parameters and visualise the solution won't work. For this case, should we have it just output the solution as a logical (binary) vector?

Also, I wonder if the shiny apps should go in their own separate R package (eg. prioritizrshiny?), and the R interface should have a different package name (eg. prioritizrcli?), and the real "prioritizr" package would just be a package that imports the two packages (like tidyverse does for dplyr, plyr and etc)?

from prioritizr.

ricschuster avatar ricschuster commented on May 21, 2024

from prioritizr.

jeffreyhanson avatar jeffreyhanson commented on May 21, 2024

Ok, sounds good.

Ok, I'll create a new repo called "prioritizrutils" and put the code there (now that I think about it, cli sounds wrong because its still within R).

from prioritizr.

jeffreyhanson avatar jeffreyhanson commented on May 21, 2024

I've been thinking more about how the different packages should be managed.

I still think it's good having the main R interface in a separate package from the shiny and data packages. But I realised that if we have the "prioritizrutils" in a separate package from the main "prioritizr" package this would mean that all the "useful" help files and package vignettes would be located in a different package. I worry that this might make it harder for users to navigate the help files. What do you think?

from prioritizr.

ricschuster avatar ricschuster commented on May 21, 2024

from prioritizr.

jeffreyhanson avatar jeffreyhanson commented on May 21, 2024

I've just pushed the bulk of priorititzrutils here and everything seems to work. I'll delete prioritizrutils now that it's not needed?

from prioritizr.

ricschuster avatar ricschuster commented on May 21, 2024

from prioritizr.

jeffreyhanson avatar jeffreyhanson commented on May 21, 2024

The package has had the marxan_problem function to accept Marxan input data for a while now, so I'm closing this issue.

from prioritizr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.