knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE, fig.retina = 2, collapse = TRUE)

Project Status: Concept – Minimal or no implementation has been done yet, or the repository is only intended to be a limited example, demo, or proof-of-concept. Travis-CI Build Status

Libraries

library(effisr)
library(dplyr)
library(sf)
library(ggplot2)
library(hrbrthemes) # not 100% necessary
library(leaflet)

Current

x <- ef_current(country = "IT", limit = 250, ordering = "-firedate")
glimpse(x)

leaflet(x) %>%
   addTiles() %>%
   addPolygons(label = ~area_ha)

Trend

x <- purrr::map_df(list("IT", "FR", "ES"), ~{ef_trend(country = .x, decimate = 7)})
glimpse(x)

ggplot(x, aes(day, current_ba, group = country, color = country)) + 
      geom_step() + 
      scale_x_date(expand=c(0,1), date_labels = '%b', date_breaks = 'month') +
      labs(x=NULL,
           title="Burnt Areas",
           subtitle="",
           caption="Source: EFFIS") + 
      theme_ipsum()

Fires

x <- ef_fires(country_iso2 = "FR")
glimpse(x)

leaflet(x) %>%
   addTiles() %>%
   addPolygons(label = ~area, col = "red", weight = 4)

Cumulative

IT_cum <- ef_hcu("IT", 2006:2018)
glimpse(IT_cum)

ggplot(IT_cum, aes(date, trend_ba, group = year, colour = trend_ba)) +
        geom_step() +
        scale_x_date(expand=c(0, 25), date_labels = '%b', date_breaks = '2 months') +
        scale_color_gradient(low = 'blue', high = 'red') +
        geom_text(data = IT_cum[IT_cum$date=='1976-12-30',], 
                  aes(label=year), 
                  hjust = -0.1, 
                  vjust = 0.4, size = 3) +
        labs(x = NULL,
             title = "Cumulative Burnt Areas (_ba) by year (Italy)",
             color = "Year",
             subtitle = "",
             caption = "Source: EFFIS") +
        guides(colour = FALSE) +
        theme_ipsum()

ES_cum <- ef_hcu("ES", 2006:2018)
glimpse(ES_cum)

ggplot(ES_cum, aes(date, trend_nf, group = year, colour = trend_nf)) + 
        geom_step() +
        scale_x_date(expand=c(0, 25), date_labels = '%b', date_breaks = '2 months') +
        scale_color_gradient(low = 'blue', high = 'red') +
        geom_text(data = ES_cum[ES_cum$date=='1976-12-30',], 
                  aes(label=year), 
                  hjust = -0.1, 
                  vjust = 0.4, size = 3) +
        labs(x = NULL,
             title = "Cumulative Number of fires (_nf) by year (Spain)",
             color = "Year",
             subtitle = "",
             caption = "Source: EFFIS") +
        guides(colour = FALSE) +
        theme_ipsum()

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.



patperu/effisr documentation built on June 15, 2019, 2:49 p.m.