mtennekes / tmap-workshop Goto Github PK
View Code? Open in Web Editor NEWWorkshop: plotting spatial data in R
License: GNU General Public License v3.0
Workshop: plotting spatial data in R
License: GNU General Public License v3.0
Hi Martijn, I am trying to work out how to add bathymetry lines to a tmap, I have tried converting a marmot bathymetry map of the area I specifically would like to use, as.raster but I am unable to use so far in tmap. The maps are for a species of shearwater I am researching showing their habitat use. Can I add bathymetry data to tmap?
or is there a better way to do it in tmap by not using marmap, I am getting a lot of errors and wandering if tmap and marmap are not compatible?
Kind regards
Penny
tmap wedgies.pdf
marmap1-bathy.pdf
#Create the bathymetry map using marmap
library(marmap)
papoue <- getNOAA.bathy(lon1 = 100, lon2 = 180, lat1 = -60, lat2 = 40, resolution = 15)
plot(papoue, land = TRUE, deep = c(-9000, -3000, 0),
shallow = c(-3000, -10, 0),
step = c(1000, 1000, 0),
lwd = c(0.8, 0.8, 1), lty = c(1, 1, 1),
col = c("lightgrey", "darkgrey","black"),
drawlabel = c(FALSE, FALSE, FALSE))
bathy<-marmap::as.raster(papoue)
class(bathy)
#Create a map using data from wedgetailed shearwaters from Muttonbid Island
library(tmap)
library(tmaptools)
data(World)
tmap_mode("plot")
library(raster)
#add it to tmap maps?
tmap::tm_shape(mtnr)+tm_raster(palette = "YlGnBu", legend.show = FALSE)+tm_shape(World)+tm_borders()+
tm_grid(col ="gray80", alpha = 0.3)+tm_fill(col = "black")+
tm_xlab("Longitude", size = 0.8)+tm_ylab("Latitude", size = 0.8)+
tm_layout(title = "(a) n = 19", scale = 0.7, main.title.size = 0.8,title.position = c('left','bottom'))+
tm_shape(siteMT)+tm_dots(size = 0.2, shape = 8, col = "red")+
tm_shape(siteMG)+tm_dots(size = 0.2, shape = 8, col = "green")+
tm_shape(siteGI)+tm_dots(size = 0.2, shape = 8, col = "green")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.