Created
May 8, 2019 23:34
-
-
Save renato04/e55c8df7a721f9610d739ca7c39ebeff to your computer and use it in GitHub Desktop.
R Special Values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Special Values | |
na = NA | |
nan = NaN | |
infinity = Inf | |
less_inifinity = -Inf | |
null = NULL | |
my_vector = c(na, nan, infinity, less_inifinity, null) | |
length(my_vector) | |
# Special Value Verification | |
print('NA Verification') | |
is.na(na) | |
is.na(nan) | |
print('NaN Verification') | |
is.nan(nan) | |
is.nan(na) | |
print('Null Verification') | |
is.null(NULL) | |
is.null(na) | |
print('Inifinity Verification') | |
is.infinite(infinity) | |
is.infinite(less_inifinity) | |
is.finite(infinity) | |
is.finite(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment