View source: R/replace_non_finite.R
replace_non_finite | R Documentation |
Replaces all instances of non-finite data (NA
, NaN
, Inf
, and -Inf
).
replace_non_finite(x, replace = 0)
x |
A vector or |
replace |
A value to replace non-finite data with. |
A vector or magpie
object, same as x
.
Michaja Pehl
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.