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
Each call to mbind() in which the first argument is a magpie object with duplicated dimnames (also if it is the only argument), the count of all individual duplicated dimnames is squared in the result
Data1 Value
1 foo 1
2 foo 2
3 bar 10
4 bar 20
5 bar 30
x <- mbind(x)
as.data.frame(x)[,c('Data1', 'Value')]
Data1 Value
1 foo 1
2 foo 2
3 foo 1
4 foo 2
5 bar 10
6 bar 20
7 bar 30
8 bar 10
9 bar 20
10 bar 30
11 bar 10
12 bar 20
13 bar 30
which leads to memory use to explode
x <- mbind(lapply(1:3, function(x) { as.magpie(setNames(x, 'foo')) }))
cat(' count size\n')
for (i in 0:4) {
if (0 < i)
x <- mbind(x)
cat(sprintf('%i %8i %12i bytes\n',
i, max(rle(sort(getNames(x)))[['lengths']]), object.size(x)))
}
Each call to
mbind()
in which the first argument is amagpie
object with duplicated dimnames (also if it is the only argument), the count of all individual duplicated dimnames is squared in the resultwhich leads to memory use to explode
and R crashing (see [↑]) at some point that is unrelated to the point where the duplicates were introduced (usually four
mbind()
calls further on).Since we can't have a check against introducing duplicates (#151), maybe we can have
mbind()
not doing this?The text was updated successfully, but these errors were encountered: