TransWikia.com

How to: Plot global mean precipitation data from the NDAA onto map regions?

Data Science Asked by n.baes on February 14, 2021

Wondering how to/ if I can display amount of rainfall across regions (in env variable) on the map areas so that the points only pertain to separate languages and sized by rainsetPropn. Have used data from the NDAA climate prediction centre for precipitation data (averaged over 30 years). This is what I wish to plot on the map regions versus in dots. I have a variable and respective coordinates for regions: Africa, Australia, Papunesia, South America, North America, Eurasia. enter image description here

Data available here

This is the current code for the image:


#install.packages("rnaturalearth")
#install.packages("rnaturalearthdata")
 
#library(rnaturalearth)
#library(rnaturalearthdata)

world <- ne_countries(scale = "medium", returnclass = "sf")

d$longitude <- if_else(d$longitude<180, d$longitude+0, d$longitude-360) #this line recalculates longitude values so they map onto the world correctly.
 
ggplot(data = world) + 
  geom_sf(color = "black", fill = "black") + 
  xlab("Longitude") + ylab("Latitude") + theme_bw() +
  ggtitle("Map of languages + env + rainsetPropn", subtitle = "XX languages") +
  geom_point(data = d, aes(x = longitude, y = latitude, colour = env, size = rainsetPropn), shape = 20, show.legend  = TRUE) +
  coord_sf(xlim = c(-180, 180), ylim = c(-90, 90), expand = FALSE) +  #this is where the coordinates can be restricted for greater clarity of a single region
  theme(panel.grid.major = element_blank(), panel.background = element_rect(fill = "aliceblue"))
  

So far, I have found this site: but not sure if helpful for this purpose (beginner here).

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP