# NOT RUN {
dir.create(file.path(tempdir(), "EDGARv432"))
folder <- setwd(file.path(tempdir(), "EDGARv432"))
url <- "http://jeodpp.jrc.ec.europa.eu/ftp/jrc-opendata/EDGAR/datasets/v432_AP/NOx"
file1 <- 'v432_NOx_2012_IPCC_1A1a.0.1x0.1.zip'
file2 <- 'v432_NOx_2012_IPCC_1A2.0.1x0.1.zip'
file3 <- 'v432_NOx_2012_IPCC_1A3b.0.1x0.1.zip'
download.file(paste0(url,'/ENE/',file1), file1)
download.file(paste0(url,'/IND/',file2), file2)
download.file(paste0(url,'/TRO/',file3), file3)
unzip('v432_NOx_2012_IPCC_1A1a.0.1x0.1.zip')
unzip('v432_NOx_2012_IPCC_1A2.0.1x0.1.zip')
unzip('v432_NOx_2012_IPCC_1A3b.0.1x0.1.zip')
nox <- read(file = dir(pattern = '.nc'),version = 'EDGAR_v432')
setwd(folder)
sp::spplot(nox, scales = list(draw=TRUE), xlab="Lat", ylab="Lon",main="NOx emissions from EDGAR")
d1 <- gridInfo(paste(system.file("extdata", package = "EmissV"),"/wrfinput_d01",sep=""))
d2 <- gridInfo(paste(system.file("extdata", package = "EmissV"),"/wrfinput_d02",sep=""))
nox_d1 <- rasterSource(nox,d1)
nox_d2 <- rasterSource(nox,d2)
image(nox_d1, axe = FALSE, main = "NOx emissions from transport-energy-industry for d1 (2012)")
image(nox_d2, axe = FALSE, main = "NOx emissions from transport-energy-industry for d2 (2012)")
# }
Run the code above in your browser using DataLab