pik-piam / quitte

Bits and pieces of code to use with quitte-style data frames
0 stars 10 forks source link

default handling of Inf in read.quitte #33

Closed chroetz closed 2 years ago

chroetz commented 2 years ago

Currently read.quitte("scenario.mif") throws a (non-helpful) warning if the mif file contains Inf or -Inf as values. This can be prevented by adding "Inf", "-Inf" to the argument na.strings, e.g., read.quitte("scenario.mif", na.strings = c("UNDF", "NA", "N/A", "n_a", "Inf", "-Inf")). It would be nice if either this would be the default or if "Inf" would be correctly parsed as the value Inf.

chroetz commented 2 years ago

A change in read.quitte, potentially requires or suggests changes here:

0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q commented 2 years ago

I will extend the warning to make it clear that readr::problems() is meant (pik-piam/quitte#34). And the Inf entries in the .mif files are neither "undefined", nor "not applicable", but actually an error in REMIND post-processing (pik-piam/remind2#132). I can't think of a scenario where REMIND would need to legitimately report an Inf value. Maybe some elasticity, but we neither report them nor are we using infinite elasticities at the moment. So no on the suggested change.