Description Usage Arguments Value Examples
View source: R/get_density_map.R
This function
creates a map based on the dataframe
assigned to argument data
that creates a map showing the values of the column
assigned to the fill_by
argument with a gradient scale.
1 |
data |
The |
fill_by |
The |
legend |
The |
title |
The |
gradmin |
Lowest value shown in the gradient scale. Default: 0. |
gradmax |
Highest value shown in the gradient scale. Default: 100. |
gradnum |
Number of intervals shown in the gradient scale. Default: 4. |
colors |
The color gradient of "fill_by" info. Default: "#FFFFFF","#224d77". |
Plots a map with a gradient scale using epsg: 3035 as a projection (Azimuthal equal area focused on the European Union) showing the values of the selected column
from the selected dataframe
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | Country <- c("Austria", "Belgium", "Bulgaria", "Croatia")
EPP <- c(7,22,31,48)
SD <- c(41,15,28,33)
Other <- c(35,42,10,5)
IN <- c(25,34,42,14)
df.data <- data.frame(Country, EPP, SD, Other, IN)
library("rnaturalearth")
library("rnaturalearthdata")
library("ggplot2")
world <- ne_countries(scale = "medium", returnclass = "sf")
t_world <- merge(world, df.data, by.x="name_long", by.y="Country")
get_density_map(t_world, t_world$EPP, legend="Seats", title= "Seats Held by EPP", gradmax=50, gradnum =5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.