Learn R Programming

MarineSPEED

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

Installation:

devtools::install_github("samuelbosch/marinespeed")

Example usage:

library(marinespeed)

## list of all species
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)

Copy Link

Version

Install

install.packages('marinespeed')

Monthly Downloads

4

Version

0.1.0

License

GPL (>= 3)

Maintainer

Samuel Bosch

Last Published

February 17th, 2017

Functions in marinespeed (0.1.0)

get_folds

Get folds
kfold_data

Get the data associated with a fold
get_occurrences

Get occurrence records
kfold_disc

Create k disc based folds for cross-validation
get_background

Get background data
geographic_filter

Filter points based on distance to other points
get_version

Get MarineSPEED version
get_fold_data

Get fold data
kfold_occurrence_background

Create k folds of occurrence and background data for cross-validation
kfold_grid

Create k grid based folds for cross-validation
plot_folds

plot folds
list_species

List species
lapply_kfold_species

Apply a function over the folds of a set of species
species_info

Species information
lapply_species

Apply a function over a set of species
marinespeed

marinespeed: Marine SPEcies and Environmental Data