Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter historic datawith low accuracy or faulty aggregation in compareScenarios2() #173

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '32899410'
ValidationKey: '33091320'
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
- 'Warning: namespace ''.*'' is not available and has been replaced'
Expand Down
2 changes: 1 addition & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "remind2: The REMIND R package (2nd generation)",
"version": "1.73.0",
"version": "1.74.0",
"description": "<p>Contains the REMIND-specific routines for data and model output manipulation.<\/p>",
"creators": [
{
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: remind2
Type: Package
Title: The REMIND R package (2nd generation)
Version: 1.73.0
Date: 2022-01-25
Version: 1.74.0
Date: 2022-01-26
Authors@R: as.person(c(
"Renato Rodrigues <renato.rodrigues@pik-potsdam.de> [aut,cre]"))
Description: Contains the REMIND-specific routines for data and model output manipulation.
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export(reportTrade)
export(toolRegionSubsets)
export(validationREMIND)
export(validationSummary)
import(magclass)
importFrom(RColorBrewer,brewer.pal)
importFrom(abind,abind)
importFrom(assertr,assert)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The REMIND R package (2nd generation)

R package **remind2**, version **1.73.0**
R package **remind2**, version **1.74.0**

[![CRAN status](https://www.r-pkg.org/badges/version/remind2)](https://cran.r-project.org/package=remind2) [![R build status](https://github.com/pik-piam/remind2/workflows/check/badge.svg)](https://github.com/pik-piam/remind2/actions) [![codecov](https://codecov.io/gh/pik-piam/remind2/branch/master/graph/badge.svg)](https://codecov.io/gh/pik-piam/remind2) [![r-universe](https://pik-piam.r-universe.dev/badges/remind2)](https://pik-piam.r-universe.dev/ui#builds)

Expand Down Expand Up @@ -47,7 +47,7 @@ In case of questions / problems please contact Renato Rodrigues <renato.rodrigue

To cite package **remind2** in publications use:

Rodrigues R (2022). _remind2: The REMIND R package (2nd generation)_. R package version 1.73.0, <URL: https://github.com/pik-piam/remind2>.
Rodrigues R (2022). _remind2: The REMIND R package (2nd generation)_. R package version 1.74.0, <URL: https://github.com/pik-piam/remind2>.

A BibTeX entry for LaTeX users is

Expand All @@ -56,7 +56,7 @@ A BibTeX entry for LaTeX users is
title = {remind2: The REMIND R package (2nd generation)},
author = {Renato Rodrigues},
year = {2022},
note = {R package version 1.73.0},
note = {R package version 1.74.0},
url = {https://github.com/pik-piam/remind2},
}
```
34 changes: 34 additions & 0 deletions inst/markdown/compareScenarios2/cs2_main.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,40 @@ dataHist %>%
filter(period %in% params$yearsHist, !is.na(value)) ->
dataHist

# filter faulty historic data
# (see e.g. https://github.com/pik-piam/mrremind/issues/194)
# TODO: can be removed once it is being dealt with on the mrremind end
dataHist <- dataHist %>%
# filter regional cement and steel production data from IEA ETP
anti_join(
expand_grid(
model = grep('^IEA ETP', getModels(dataHist), value = TRUE),
region = setdiff(getRegs(dataScen), 'World'),
variable = c('Production|Industry|Cement',
'Production|Industry|Steel')),

c('model', 'region', 'variable')
) %>%
# remove regional and global data from IEA WEO 2021
0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q marked this conversation as resolved.
Show resolved Hide resolved
anti_join(
bind_rows(
expand_grid(
model = c('IEA WEO 2021 APS GLO',
'IEA WEO 2021 Net2050 GLO',
'IEA WEO 2021 SDS GLO',
'IEA WEO 2021 SPS GLO'),
region = setdiff(getRegs(dataScen), 'World')),

expand_grid(
model = c('IEA WEO 2021 APS regional',
'IEA WEO 2021 SDS regional',
'IEA WEO 2021 SPS regional'),
region = 'World')
),

c('model', 'region')
)

# Combine into one data frame and remove old.
data <- bind_rows(dataScen, dataHist)
rm(dataScen, dataHist)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test-dummy.R