Description Usage Arguments Value Examples
View source: R/EPDr-plotting_functions.R
This function uses information on multiple epd.entity.df-class
objects to map counts for a particular taxa in a particular age (or time
period). The function use ggplot function and allow for multiple
parameters to further tune the resulting map. Each entity in the map
is represented by a point, which size, border colour, and fill colour
change according to the palynological count. When an entity is provided
but it has no data for that particular age (or time period) the points
are represented diferently to reflect NA
, avoiding confusion
with 0
(zero) values.
1 2 3 4 5 6 | map_taxa_age(x, taxa, sample_label, pres_abse = FALSE, pollen_thres = NULL,
zoom_coords = NULL, points_pch = 21, points_colour = NULL,
points_fill = NULL, points_range_size = NULL, map_title = NULL,
legend_range = NULL, legend_title = NULL, napoints_size = 0.75,
napoints_colour = "grey45", napoints_fill = "grey45",
countries_fill_colour = "grey80", countries_border_colour = "grey90")
|
x |
List of |
taxa |
Character string indicating the taxa that are going to be mapped. |
sample_label |
Character string indicating the age (or time period) to be mapped. |
pres_abse |
Logical value indicating whether the map will represent presence/absence or counts (absolute or percentages). |
pollen_thres |
Logical value indicating the pollen count threshold to plot an specific count as presence or absence. |
zoom_coords |
Numeric vector with 4 elements defining the bounding
box of the map as geographical coordinates. It should have the
following format |
points_pch |
Any value accepted for |
points_colour |
Two elements vector with any values accepted for |
points_fill |
Two elements vector with any values accepted for |
points_range_size |
Two elements vector with any values accepted for |
map_title |
Character string with a title for the map. |
legend_range |
Two elements vector with numeric values to set different min and max
limits of points representation. If you have a dataset where counts goes up to 98 but
want the map to represent until 100, you can set |
legend_title |
Character string with a title for the legend. |
napoints_size |
Any value accepted for |
napoints_colour |
Any value accepted for |
napoints_fill |
Any value accepted for |
countries_fill_colour |
Any value accepted for |
countries_border_colour |
Any value accepted for |
The function displays a ggplot map with countries in the background and counts for particular taxa and age (or time periods) as points in the foreground.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## Not run:
epd.connection <- connect_to_epd(host = "localhost", database = "epd",
user = "epdr", password = "epdrpw")
entity.list <- list_e(epd.connection, country = c("Spain","Portugal",
"France", "Switzerland",
"Austria", "Italy",
"Malta", "Algeria",
"Tunisia", "Morocco",
"Atlantic ocean",
"Mediterranean Sea"))
epd.all <- lapply(entity.list$e_, get_entity, epd.connection)
epd.all <- lapply(epd.all, filter_taxagroups, c("HERB", "TRSH", "DWAR",
"LIAN", "HEMI", "UPHE"))
epd.all <- lapply(epd.all, giesecke_default_chron)
epd.all <- remove_restricted(epd.all)
epd.all <- remove_wo_ages(epd.all)
epd.int <- lapply(epd.all, interpolate_counts, seq(0, 22000, by = 1000))
epd.taxonomy <- get_taxonomy_epd(epd.connection)
epd.int <- lapply(epd.int, taxa_to_acceptedtaxa, epd.taxonomy)
epd.int <- unify_taxonomy(epd.int, epd.taxonomy)
epd.int.per <- lapply(epd.int, counts_to_percentage)
map_taxa_age(epd.int, "Cedrus", "21000", pres_abse = F)
map_taxa_age(epd.int, "Cedrus", "21000", pres_abse = T)
map_taxa_age(epd.int.per, "Cedrus", "21000", pres_abse = F)
map_taxa_age(epd.int.per, "Cedrus", "21000", pres_abse = T)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.