R code for working with the Marine SPEcies and Environmetal Data (MarineSPEED.org) dataset
R
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
R
man
tests
vignettes
.Rbuildignore
.gitignore
.travis.yml
DESCRIPTION
LICENSE.md
NAMESPACE
NEWS.md
README.md
cran-comments.md
marinespeed.Rproj

README.md

GPLv3 Build Status Coverage Status CRAN_Status_Badge

MarineSPEED

R code for downloading and working with the Marine SPEcies and Environmental Data (MarineSPEED.org) benchmark dataset.

Installation:

    install.packages("marinespeed")
    # or 
    devtools::install_github("lifewatch/marinespeed")

Example usage:

    library(marinespeed)
    
    ## get species list
    species <- list_species()
    View(species)
    
    ## count number of occurrences for all species 
    get_occ_count <- function(speciesname, occ) {
      nrow(occ)
    }
    record_counts <- lapply_species(get_occ_count)
    print(sum(unlist(record_counts)))
    
    ## plot first 2 folds for the first 10 species
    plot_occurrences <- function(speciesname, data, k) {
       title <- paste0(speciesname, " (fold = ", k, ")")
       plot(data$occurrence_train[,c("longitude", "latitude")], pch=".", 
            col="blue", main = title)
       points(data$occurrence_test[,c("longitude", "latitude")], pch=".", 
              col="red")
    }
    
    # plot training (blue) and test (red) occurrences of the first 2 disc folds 
    # for the first 10 species
    species <- list_species()
    lapply_kfold_species(plot_occurrences, species=species[1:10,],
                         fold_type = "disc", k = 1:2)