我很欣赏如何做到这一点,所以我们可以相互比较.
这是一个开始:
is.natural <- function(x) { x>0 && identical(round(x), x) }
performance r
performance ×1
r ×1