knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/" )
rangeMapper
builds upon three types of data:rangeMapper
is build on three concepts:require(rangeMapper) require(sf) require(data.table) require(ggplot2) require(patchwork) con = rmap_connect() rmap_add_ranges(con, x = wrens, ID = 'sci_name') rmap_prepare(con, 'hex', cellsize = 500) rmap_add_bio(con, wrens, 'sci_name') rmap_save_map(con, fun= 'avg', v = 'clutch_size', src='wrens', dst='cs') cs = rmap_to_sf(con, 'cs') cnv = rmap_to_sf(con, 'wkt_canvas') thm = theme_bw() +theme(plot.margin = unit(c(0,0,0,0), "cm") ) g1 = ggplot() + geom_sf(data = wrens, aes(), alpha= 0.2, size = 0.3) + thm + ggtitle('Distribution ranges') + scale_y_continuous(position = "right") + ylab('⇧') + theme(axis.title=element_text(size=30, color = "grey60") ) g2 = ggplot() + geom_sf(data = cnv, aes(), size = 0.3) + thm + ggtitle('Canvas') + scale_y_continuous(position = "right") + ylab('⇧') + theme(axis.title=element_text(size=30, color = "grey60") ) g3 = ggplot(cs) + geom_sf(aes(fill = avg_clutch_size), size= 0.05, color = 'grey90', show.legend = FALSE) + scale_fill_gradientn(colours = viridis::viridis(10, option = 'E') ) + thm + ggtitle('Map') x = data.frame(Species = c('S1', 'S2', 'S3', '...', 'Si'), Trait = c('t1', 't2', 't3', '...', 'ti')) T = ggplot() + ggpmisc::annotate(geom = "table", x = 0, y = 0, size= 5, label = list(x) ) + scale_x_continuous(position = "top") + xlab('⇧') + guides(x = "none", y = "none") + ylab(NULL) + theme_minimal() + theme(axis.title=element_text(size=30, color = "grey60") ) (g1 + g2 + g3)/(plot_spacer() +T + plot_spacer())
rangeMapper
's project containers are sqlite
files.
# Install release version from CRAN install.packages("rangeMapper") # Install development version from GitHub remotes::install_github("mpio-be/rangeMapper")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.