Skip to content

Commit

Permalink
Changed how ignored data is printed in validationpdf.R
Browse files Browse the repository at this point in the history
  • Loading branch information
stephnwirth committed Jan 15, 2018
1 parent 8557058 commit 268805d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: mip
Type: Package
Title: Comparison of multi-model runs
Version: 0.97.3
Date: 2017-10-06
Version: 0.98.0
Date: 2018-01-15
Author: David Klein, Benjamin Leon Bodirsky, Florian Humpenoeder, Lavinia Baumstark, Jerome Hilaire
Maintainer: David Klein <dklein@pik-potsdam.de>
Description: Package contains generic functions to produce comparison plots of multi-model runs.
Expand Down
24 changes: 18 additions & 6 deletions R/validationpdf.R
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,26 @@ validationpdf <- function(x,hist,file="validation.pdf",style="comparison", only_
}
if(!is.null(stats$ignored_all0)) {
swlatex(sw,"\\section{Ignored data}")
if(!is.null(stats$ignored_all0$x)) {
swlatex(sw,"Data contains only a mix of 0 and NA values and is ignored.")
swR(sw,cat,stats$ignored_all0$x,sep="\n")
if(!is.null(stats$ignored_all0$x) && !is.null(stats$ignored_all0$hist)) {
swlatex(sw, "Variables of data and validation data that only contain a mix of 0 and NA values and are ignored.")
swR(sw, cat, intersect(stats$ignored_all0$x, stats$ignored_all0$hist), sep="\n")
}
if(!is.null(stats$ignored_all0$hist)) {
swlatex(sw,"Validation data contains only a mix of 0 and NA values and is ignored.")
swR(sw,cat,stats$ignored_all0$hist,sep="\n")
if(!is.null(stats$ignored_all0$x)){
swlatex(sw, "Data contains only a mix of 0 and NA values and is ignored, but validation data contains other values.")
swR(sw, cat,setdiff(stats$ignored_all0$x, stats$ignored_all0$hist) ,sep="\n")
}
if(!is.null(stats$ignored_all0$hist)){
swlatex(sw, "Validation data contains only a mix of 0 and NA values and is ignored, but data contains other values.")
swR(sw, cat,setdiff(stats$ignored_all0$hist, stats$ignored_all0$x) ,sep="\n")
}
# if(!is.null(stats$ignored_all0$x)) {
# swlatex(sw,"Data contains only a mix of 0 and NA values and is ignored.")
# swR(sw,cat,stats$ignored_all0$x,sep="\n")
# }
# if(!is.null(stats$ignored_all0$hist)) {
# swlatex(sw,"Validation data contains only a mix of 0 and NA values and is ignored.")
# swR(sw,cat,stats$ignored_all0$hist,sep="\n")
# }
}
if(length(xtrax)>0 | length(xtrahist)>0) {
swlatex(sw,"\\section{Non-Matching Data}")
Expand Down

0 comments on commit 268805d

Please sign in to comment.