library(sp)
#' @export
spatialpoints_bold <- function (reefishBold, projectionCRS="+init=epsg:3347") {
## define coordinates of BOLD points as spatialpoints and projection in mter unit
bold.coo <- data.frame(lon=reefishBold$lon,
lat= reefishBold$lat
)
## define information species/sequence related to each point BOLD
infobold <- data.frame(species_name=reefishBold$species_name,
fishbase_species_name=reefishBold$fishbase_species_name,
genus_name=reefishBold$genus_name,
family_name=reefishBold$family_name,
order_name=reefishBold$order_name,
class_name=reefishBold$class_name,
sequence=reefishBold$sequence
)
bold.pts <- sp::SpatialPointsDataFrame(bold.coo,
data=infobold,
proj4string=sp::CRS("+init=epsg:4326")
)
bold.sp <- sp::spTransform(bold.pts,
sp::CRS(projectionCRS)
)
return(bold.sp)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.