knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) library(tidyverse)
Clean your code
Load in Data
gbif_raw <- read.csv(system.file('extdata','gbif.csv.gz', package = "evogear")) gbif_1 <- clean_gbif(gbif_raw) df_kde <- data.frame(species = gbif_1$species, decimallongitude = gbif_1$decimallongitude, decimallatitude = gbif_1$decimallatitude) gbif_2 <- KDE_filter(df_kde,FALSE, rec_min = 3)
Here we introduce the function points_to_poly.
This function intends to take a dataframe of points and convert them into polygons. This can be done either by creating a circular plane around each point given a set diameter, through Alpha Hull, or via MCP.
It requires a few argumeasd:
points2Poly <- function(points,x = 'x', y = 'y', species = 'species', map, alpha = FALSE, a = 1, type = 'All', buffer_m = 1000){...}
points
a 3 column dataframe of points, where the columns are species, x, and y
x
the column containing the x coords
points
x
y
species
map
alpha
a
type
buffe_m
#Load in the required packages require(raster) require(alphahull) require(dismo) require(rangeBuilder)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.