Code Monkey home page Code Monkey logo

marxan's Introduction

This software has been abandoned because I do not have time to maintain it. It is not guaranteed to work and requires substantial changes to keep it up to date and make it apropriate for submission to CRAN. Use this software at your own peril.

marxan's People

Contributors

jeffreyhanson avatar mstrimas avatar alesarrett avatar fguilhaumon avatar mattwatts avatar

Stargazers

Ricardo Oliveros-Ramos avatar Javier Fajardo avatar Martinez-Lopez Javier avatar Emma Ladouceur avatar Nathan Sutton avatar  avatar  avatar Jessie Wells avatar  avatar

Watchers

 avatar  avatar  avatar Ricardo Oliveros-Ramos avatar  avatar Jessie Wells avatar  avatar  avatar

marxan's Issues

update() faster than second marxan()

Hi!

I have noticed that update() a MarxanSolved with new parameters is much faster on my computer than performing a new marxan() execution with those same new parameters.
As (I think) this update does not have an equivalent on running Marxan unconnected form R, I am wondering if there is any difference between those two ways, and if one is more appropriate than the other for any reason.
Thanks for the help! (and the package)

Possible bug in rcpp_calcBoundaryDF.cpp

First, thanks for developing this useful package! I believe there is an issue with the calculate of boundaries for bound.dat. This simple 3x3 grid of hexagons illustrates the problem:

library(sp)
library(marxan)
library(magrittr)
library(dplyr)
utm10 <- crs('+proj=utm +zone=10 +ellps=GRS80 +datum=NAD83 +units=m +no_defs')
pts <- extent(c(0, 5000, 0, 5000)) %>% 
    as('SpatialPolygons') %>% 
    spsample(type='hexagonal', cellsize=(1000 * sqrt(3)))
hex <- HexPoints2SpatialPolygons(pts)
plot(hex)
plot(pts, pch=19, add=T)
plot(hex[c(1),], col='red', add=T)
plot(hex[c(2,4),], col=c('green','blue'), add=T)

hexagons

Calculating boundaries using the default tolerance leads to most hexagons not having any shared boundary.

calcBoundaryData(hex) %>% arrange(id1, id2)
# Results
# id1 id2 boundary
#1    1   1     6000
#2    2   2     6000
#3    3   3     6000
#4    4   4     6000
#5    5   5     5000
#6    5   8     1000
#7    6   6     6000
#8    7   7     6000
#9    8   8     5000
#10   9   9     6000

Fiddling with the tolerance yields better results but some shared boundaries are missing.

calcBoundaryData(hex, tolerance=0.1) %>% arrange(id1, id2)
# Results
# id1 id2 boundary
#1    1   1     5000
#2    1   2     1000
#3    2   2     3000
#4    2   3     1000
#5    2   4     1000
#6    3   3     4000
#7    3   5     1000
#8    4   4     3000
#9    4   5     1000
#10   4   7     1000
#11   5   5     2000
#12   5   6     1000
#13   5   8     1000
#14   6   6     4000
#15   6   9     1000
#16   7   7     4000
#17   7   8     1000
#18   8   8     3000
#19   8   9     1000
#20   9   9     4000

Most boundaries are caught, but those shared boundaries oriented in a NW-SE direction are missed. For example, hexagon 1 (red above) is missing the boundary with hexagon 4 (blue above) and the extra 1000m is assigned to the self-boundary of 1.

I have limited experience with C++, but I believe I've fixed the issues in the source code with a couple small changes, which are in this commit in my forked repository. The function appears to work fine on my machine now.

Where is RStudio saving the files?

Hello,

Thanks for your work on this package! I'm working through the tutorial. For the description about the function 'marxan' you write;
" ...(2) saving the input data to a folder on the computer, (3) copying the MARXAN executable file to that folder, (4) running MARXAN,... "

Where is this taking place? Where are the files saved to? They aren't appearing in my folder for the RStudio Project. I hope this doesn't seem trivial, I want to understand how it is all working.

Many thanks,
Tom

passing large data between marxan and r is slow

have r preallocate arrays, and then have marxan populate them with results, this avoid issues with sending large amounts of data to and from marxan, and also we can avoid using Rcpp data structure or Rcpp data structures and stick with C. this will facilitate the marxan interoperating with other non-R systems, eg. idrisi, qmarxan, arcgis, qgis, cluz

malloc(): memory corruption

Hi,

I have a set of data for which I cannot run marxan. I have no problems passing the "MarxanData" step bu then the "solve" function will not work (I dump bellow the messages). Changing pu cost values or species targets values as no effect on the solving issue. Working with a similar data set (26438 PU and 607 sp) makes no problem. Any help or pointer appreciated.

Cheers

    Marxan v 2.43 

Marine Reserve Design via Annealing

Coded by Ian Ball, modified by Matthew Watts
Written by Ian Ball and Hugh Possingham

[email protected]
[email protected]
[email protected]

Marxan website

http://www.uq.edu.au/marxan

Entering in the data files
There are 26264 Planning units.
26264 Planning Unit names read in
593 species read in
*** Error in `/tmp/RtmpioCOIc/Mhctbpwifua/1/MarOpt_v243_Linux64': malloc(): memory corruption: 0x000000000250a6b0 ***
Aborted (core dumped)
Error in solve.MarxanUnsolved(model.unsolved) : Marxan failed to execute.

Installation fails on Mac

This is what happens when I install marxan.

devtools:::install_github('paleo13/marxan')
Downloading GitHub repo paleo13/marxan@master
from URL https://api.github.com/repos/paleo13/marxan/zipball/master
Installing marxan
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save --no-restore CMD INSTALL
'/private/var/folders/p5/bw3h9lpn7sd0zggm7bbltzy00000gn/T/Rtmpndeh3T/devtools1774e69f79b96/paleo13-marxan-d227732'
--library='/Library/Frameworks/R.framework/Versions/3.2/Resources/library' --install-tests

  • installing source package ‘marxan’ ...
    ** libs
    I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Rcpp/include" -c RcppExports.cpp -o RcppExports.o
    /bin/sh: I/Library/Frameworks/R.framework/Resources/include: No such file or directory
    make: [RcppExports.o] Error 127 (ignored)
    I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Rcpp/include" -c rcpp_Polygons2PolySet.cpp -o rcpp_Polygons2PolySet.o
    /bin/sh: I/Library/Frameworks/R.framework/Resources/include: No such file or directory
    make: [rcpp_Polygons2PolySet.o] Error 127 (ignored)
    I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Rcpp/include" -c rcpp_calcBoundaryDF.cpp -o rcpp_calcBoundaryDF.o
    /bin/sh: I/Library/Frameworks/R.framework/Resources/include: No such file or directory
    make: [rcpp_calcBoundaryDF.o] Error 127 (ignored)
    I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Rcpp/include" -c rcpp_groupcombine.cpp -o rcpp_groupcombine.o
    /bin/sh: I/Library/Frameworks/R.framework/Resources/include: No such file or directory
    make: [rcpp_groupcombine.o] Error 127 (ignored)
    I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Rcpp/include" -c rcpp_groupsum.cpp -o rcpp_groupsum.o
    /bin/sh: I/Library/Frameworks/R.framework/Resources/include: No such file or directory
    make: [rcpp_groupsum.o] Error 127 (ignored)
    -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -L/usr/local/lib -o marxan.so RcppExports.o rcpp_Polygons2PolySet.o rcpp_calcBoundaryDF.o rcpp_groupcombine.o rcpp_groupsum.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
    /bin/sh: -dynamiclib: command not found
    make: *** [marxan.so] Error 127
    ERROR: compilation failed for package ‘marxan’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/marxan’
    Error: Command failed (1)

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.