Description Usage Arguments Examples
Grid warm rain statistics
1 2 | grid.warm(df = get.cloud.summaries(), bins_lon = 180, bins_lat = 90,
out.fname = "cloud-warm-grid.rds", precip.classes = 1:3)
|
df |
Data frame to grid, |
bins_lon |
Number of bins or vector of bin boundaries (longitude) |
bins_lat |
Number of bins or vector of bin boundaries (latitude) |
out.fname |
File name for output |
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 | ## make the \code{warmrain.rda} file used by \code{data(\link{warmrain})}
library(devtools)
warmrain <- grid.warm(get.cloud.summaries(),
bins_lon = 180, bins_lat = 90,
NULL)
str(warmrain)
devtools::use_data(warmrain, pkg = "/home/jmuelmen/lib64/R/library/preciptools")
## look at the Great Lakes region, if that's your thing
df <- grid.warm(get.cloud.summaries() %>%
filter(lon > -95, lon < -75, lat > 40, lat < 50),
seq(-95, -75, 0.1), seq(40, 50, 0.1),
"great-lakes-grid.rds")
col.frac <- rev(RColorBrewer::brewer.pal(9, "RdYlBu"))[c(1:5,7,9)]
phase.breaks <- c(0, 0.05, 0.1, 0.2 * 1:5)
df %>%
mutate(sum = ice + liq + mixed) %>%
gather(phase, frac, c(ice:mixed, sum)) %>%
discretize(frac, phase.breaks, TRUE) %>%
ggplot(aes(x = lon, y = lat)) +
geom_raster(aes(fill = frac)) +
geom_world_polygon(highres = TRUE, lwd = 0.25) +
xlim(c(-95, -75)) + ylim(c(40,50)) +
scale_fill_manual(values = col.frac, drop = FALSE) +
facet_grid(phase ~ denom) +
coord_fixed(sqrt(2)) +
theme_bw()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.