set.seed(123) knitr::opts_chunk$set(cache = TRUE, collapse = FALSE, warning = FALSE, error = FALSE) library(geo2smoof)
Convert a elevation RasterLayer from the package raster or an Google Maps Elevation API Call to a function that you can optimize.
devtools::install_github("jakob-r/geo2smoof")
library(geo2smoof) # list available countries # raster::getData('ISO3') alt = raster::getData('alt', country='JAM') sf = convertRasterLayerToSmoof(raster.layer = alt) plot2DNumeric(sf, render.levels = TRUE) # find the highest point with optim() optim(c(140,80), fn = function(...) -1 * sf(...), )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.