Giter Club home page Giter Club logo

seegsdm's Introduction

Build Status CRAN

seegSDM

Streamlined Functions for Species Distribution Modelling in the SEEG Research Group.

This package contains a set of streamlined functions to fit species distribution models. The current focus is on the ensemble BRT approaches used in the recent Bhatt et al. dengue paper. The package is intended to help members of the research group to fit these and similar models, and to let other researchers scrutinise the methodology in detail. This package is not designed to be used more widely - of course you're welcome to use it and we hope it's helpful, but maintaining it and making it user-friendly is not a major focus.

Installation

You can install the package from GitHub using devtools:

devtools::install_github('SEEG-Oxford/seegSDM')

Reporting bugs

Please report bugs, issues and suggestions for extra functions using the issues tracker.

Tutorial

There is the beginnings of a tutorial/example workflow for the package here

seegsdm's People

Contributors

fshearer avatar goldingn avatar laurence-hudson-tessella avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

seegsdm's Issues

Admin rasters with large GAUL codes handled poorly.

Admin level rasters (GAUL code as pixel value) containing pixels with large values/GAUL codes cause excessive memory usage. (With GAUL codes reaching ~1M, >32GB of RAM is required)

This is associated with creation of the 'level_all_codes' in 'extractAdmin' which creates an array with size based on the largest pixel value/GAUL code in the raster, rather than by the number of unique pixel values/GAUL codes in the raster.

nearestLand function query

What does the distance in the nearestLand function mean? Is it the nearest distance of a point to the centroid of the closest raster cell? The coordinates so formed is the centroid so is this the nearest distance that is being measured?

error while running a single BRT model

Hello All,
I have a problem with applying the tutorial on this line:
brt <- runBRT(lis$data, 4:6, 1, covariates, gbm.coords = 2:3)

I have this message:
error

Thanks a lot,
Ahmed

extractBhatt does not work discrete covariates

For discrete covariates extractBhatt attempts to run extractAdmin for gaul/polygon occurrences with fun = 'modal'. This argument is passed to library(raster)'s zonal method. 'modal' is not a supported argument for zonal, R's modal (no quotes) function could work, but covariate stacks aligned to the SEEG master grid are too large for this. One option might be to use modal against one covariate layer at a time.

Issues downloading seegSDM

Hello there,

I am trying to install the seegSDM package but I am getting the following error:

devtools::install_github('SEEG-Oxford/seegSDM')
Downloading github repo SEEG-Oxford/seegSDM@master
Error in stri_detect_regex(string, pattern, opts_regex = attr(pattern, :
object 'C_stri_detect_regex' not found

Is the package still available for downloading? If so, could this be an installation bug?

Thanks very much for your assistance.

Mac OS X Yosemite 10.10.5

`seegSDM::nearestLand()` does not permit lon/lat coordinates

I am just leaving this comment here for others that are interested in taking advantage of this package - I appreciate it is not necessarily designed for wider use though. I noticed that seegSDM::nearestLand() assumes planar coordinates. It would be very helpful to add this to the documentation. Alternatively, you could consider tweaking the function to enable correct geodesic distance calculations, e.g.,:

nearestLand2 <- 
  function(points, raster, max_distance, lonlat) {
    nearest <- function(lis, raster) {
      neighbours <- matrix(lis[[1]], ncol = 2)
      point <- lis[[2]]
      land <- !is.na(neighbours[, 2])
      if (!any(land)) {
        return(c(NA, NA))
      }
      else {
        coords <- raster::xyFromCell(raster, neighbours[land, 1])
        if (nrow(coords) == 1) {
          return(coords[1, ])
        }
        # Use raster::pointDistance() or a related function to permit lon/lat distance calculations 
        dists <- raster::pointDistance(coords, cbind(point[1], point[2]), lonlat = lonlat)
        return(coords[which.min(dists), ])
      }
    }
    neighbour_list <- raster::extract(raster, points, buffer = max_distance, 
                                      cellnumbers = TRUE)
    neighbour_list <- lapply(1:nrow(points), function(i) {
      list(neighbours = neighbour_list[[i]], point = as.numeric(points[i, 
      ]))
    })
    return(t(sapply(neighbour_list, nearest, raster)))
  }

getStats fails if the BRT wasn't made with gbm.step

If runBRT was run with model='perf' or model='gbm', getStats fails as the submodels for each fold of the optimal model are not kept.

Maybe this can be fixed by running a single gbm.step starting and ending on n.trees (for method='gbm') or the result of gbm.perf (for method = 'perf')?

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.