You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scenario region variable value period unit model
1 scen CAZ FE 0 2010 US$/EJ REMIND
2 scen CAZ Price|FE 1 2010 US$/EJ REMIND
3 scen USA FE 0 2010 US$/EJ REMIND
4 scen USA Price|FE 5 2010 US$/EJ REMIND
Now, if you run toolAggregate Price|FE with FE as weight and zeroWeight = "allow", it happily returns 0:
library(madrat)
library(magclass)
library(quitte)
library(tidyverse)
d <- data.frame(scenario = "scen", region = c("CAZ", "CAZ", "USA", "USA"), variable = c("FE", "Price|FE"), value = c(0, 1, 0, 5), period = 2010, unit = "US$/EJ", model = "REMIND") %>% as.quitte() %>% as.magpie()
int2ext <- setNames("Price|FE", "FE")
map <- data.frame(region=getRegions(d), world="GLO", stringsAsFactors=FALSE)
toolAggregate(d[,,1], rel = map, weight = d[map$region,,int2ext[1]], zeroWeight = "allow")
I wonder whether it would make sense to either just return NA for zeroWeight = allow, or add a new options zeroWeight = setNA which basically set weight2 to NAhere (or just drops the + 10^-100)? This would be useful for price aggregation in remind2, where the World value currently is just set to 0, see pik-piam/remind2#642
Example data:
Now, if you run toolAggregate
Price|FE
withFE
as weight andzeroWeight = "allow"
, it happily returns 0:I wonder whether it would make sense to either just return
NA
forzeroWeight = allow
, or add a new optionszeroWeight = setNA
which basically set weight2 toNA
here (or just drops the+ 10^-100
)? This would be useful for price aggregation in remind2, where the World value currently is just set to 0, see pik-piam/remind2#642Any preference, @tscheypidi?
The text was updated successfully, but these errors were encountered: