Global Distribution of Vapor Pressure Deficit

library(ggplot2)
if(!sessionInfo()$otherPkgs$ggplot2$Version == "0.9.2.1"){
  install_version("ggplot2", version = "0.9.2.1")
}
library(hexbin)
library(ggmap)
library(maps)
library(ribis)
rh.long <- wide2long(data.wide = rh, var = "RH")
vpd.long <- wide2long(vpd, "VPD")
temp.long <- wide2long(temp, "Temp")

world <- get_map(c(-180, -60, 180, 60), source = "osm")
ggmap(world)

country_boundaries <- map_data("world")

ggmap(world) +  geom_tile(data = temp.long, aes(lon, lat, fill = Temp)) +
  scale_fill_gradient(low="blue", high="red")

ggplot(data = vpd.long, aes(lon, lat)) +
  geom_density2d(aes(fill = ..layer..))

scale_fill_gradient(low="blue", high="red") 

ggplot() +  geom_density2d(data = vpd.long, aes(lon, lat, fill = VPD))

You can also embed plots, for example:

plot(cars)


dlebauer/climate-utils documentation built on May 15, 2019, 9:13 a.m.