part <- new.magpie(letters[1:3], years = 'y1995', names = 'foo')
total <- new.magpie(letters[1:3], years = 'y1995', names = 'foo')
part[,,] <- c(0, 1, 2)
total[,,] <- c(0, 10, 10)
part / total
replace_non_finite(part / total)
Run the code above in your browser using DataLab