This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(readr) | |
| library(glue) | |
| library(RCurl) | |
| library(lubridate) | |
| library(dplyr) | |
| library(futile.logger) | |
| library(httr) | |
| library(data.table) | |
| # https://discomap.eea.europa.eu/map/fme/AirQualityExport.htm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # module load r-rgdal geos netcdf-fortran/4.5.2/gcc | |
| # legge sezioni di censimento | |
| library(sf) | |
| st_read("/lustre/arpa/bonafeg/data/geo/Popolazione/FVGconSappada_SezCens.shp") -> ps | |
| # legge popolazione | |
| library(dplyr) | |
| library(tidyr) | |
| pp <- read.csv("/lustre/arpa/bonafeg/data/geo/Popolazione/Censimento2011/R06conSappada_indicatori_2011_sezioni.csv")%>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mean_vs_rankN <- function(poll = "PM10", | |
| nrank = 36, | |
| threshold = 50, | |
| fy = 2009, | |
| ly = 2018) { | |
| library(dplyr) | |
| Dat <- readRDS(paste0("data/",poll,"_daily_",fy,"-",ly,".rds")) | |
| Dat %>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # packages | |
| library(saqgetr) | |
| library(dplyr) | |
| library(rgdal) | |
| library(tidyr) | |
| library(rgeos) | |
| library(readr) | |
| # extraction | |
| data_annual <- get_saq_simple_summaries(summary = "annual_means") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| filein <- "https://raw.githubusercontent.com/pcm-dpc/COVID-19/master/dati-regioni/dpc-covid19-ita-regioni.csv" | |
| dat <- read.csv(filein) | |
| library(dplyr) | |
| library(ggplot2) | |
| library(knitr) | |
| dat %>% | |
| mutate(terap_intens_e_deced=terapia_intensiva+deceduti) %>% | |
| group_by(regione=denominazione_regione, | |
| data=as.Date(data)) %>% | |
| summarize(terap_intens_e_deced=sum(terap_intens_e_deced)) %>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(igraph) # Load the igraph package | |
| links <- read.csv("data/network_crma_arpa_edges.csv") | |
| net <- graph_from_data_frame(d=links, directed=T) | |
| library(networkD3) | |
| wc <- cluster_walktrap(net) | |
| members <- membership(wc) | |
| igraph_to_networkD3(net, group=members) -> net_d3 | |
| net_d3$nodes$nodesize <- c(40,0)[(net_d3$nodes$name %in% links$from)+1] | |
| forceNetwork(Links = net_d3$links, Nodes = net_d3$nodes, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # libraries | |
| library(ggplot2) | |
| library(dplyr) | |
| # where is the urban area? | |
| urban <- c(rep(F,100),rep(T,100),rep(F,100)) | |
| # regional background concentrations | |
| noise <- runif(300,min=5, max = 15) | |
| regional.background <- stats::filter(noise,rep(1/40,40), sides=2, circular = T) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rm(list = ls()) | |
| library(shiny) | |
| Logged = FALSE; | |
| ## put here the credentials | |
| my_username <- "test" | |
| my_password <- "test" | |
| ## part of the user interface for login | |
| ui1 <- function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server <- function(input, output, session) {} | |
| ui <- fluidPage(singleton(tags$head(tags$script('window.location.replace("https://sdati.arpae.it/calicantus-intro");')))) | |
| shinyApp(ui = ui, server = server) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype HTML> | |
| <meta charset = 'utf-8'> | |
| <html> | |
| <head> | |
| <link rel='stylesheet' href='http://timelyportfolio.github.io/rCharts_d3_sankey/css/sankey.css'> | |
| <script src='http://d3js.org/d3.v3.min.js' type='text/javascript'></script> | |
| <script src='http://timelyportfolio.github.io/rCharts_d3_sankey/js/sankey.js' type='text/javascript'></script> | |
| <style> |