knitr::opts_chunk$set(echo = TRUE)

R Markdown

library(raster)
library(glue)
library(here)

# TODO: iterate over species
sp <- "Pseudanthias_evansi"

# get netcdf file
url <- glue("http://thredds.d4science.org/thredds/fileServer/public/netcdf/AquaMaps_08_2016/{sp}.nc")
nc <- basename(url)
download.file(url, nc)

# read netcdf into raster
r <- raster(nc, varname = "probability")

# plot to check ok
plot(r)


ecoquants/bbnj documentation built on April 4, 2023, 9:08 p.m.