Using leaflet, just because
I love it when researchers take the time to share their knowledge of the computational tools that they use. So first, let me point you at Environmental Computing, a site run by environmental scientists at the University of New South Wales, which has a good selection of R programming tutorials.
One of these is Making maps of your study sites. It was written with the specific purpose of generating simple, clean figures for publications and presentations, which it achieves very nicely.
I’ll be honest: the sole motivator for this post is that I thought it would be fun to generate the map using Leaflet for R as an alternative. You might use Leaflet if you want:
An interactive map that you can drag, zoom, click for popup information
A “fancier” static map with geographical features of interest
concise and clean code which uses pipes and doesn’t require that you process shapefiles
Without further ado:
library(leaflet)
library(readr)
point_data <- read_csv("http://environmentalcomputing.net/wp-content/uploads/2018/03/point_data.csv")
leaflet(point_data) %>%
fitBounds(lng1 = min(point_data$lon) - 0.11,
lat1 = min(point_data$lat) - 0.11,
lng2 = max(point_data$lon) + 0.11,
lat2 = max(point_data$lat) + 0.11) %>%
addCircleMarkers(~lon, ~lat,
radius = 3,
opacity = 100,
color = "white",
label = as.character(point_data$Site),
labelOptions = labe...
Source: What You're Doing Is Rather Desperate - Category: Bioinformatics Authors: nsaunders Tags: R statistics leaflet maps rstats Source Type: blogs
More News: Bioinformatics | Databases & Libraries | Environmental Health | Learning | Statistics | Study | Universities & Medical Training | Wales Health