PsyTeachR / glossary

Glossary of terms
https://psyteachr.github.io/glossary/
Other
15 stars 17 forks source link

New: NaN and Inf definition? #123

Closed ASarafoglou closed 2 years ago

ASarafoglou commented 2 years ago

NaN

An impossible number that is "Not a number"

In R impossible number are represented with the symbol NaN. Use the function is.nan() to check if values are impossible numbers.

value <- 0/0
value
is.nan(value)

Inf

A value representing positive infinity

In R infinity is represented with the symbol Inf. Use the function is.infinite() to check if values are infinite.

value <- 1/0
value
is.infinite(1/0)

# negative infinity
value <- -1/0
value
is.infinite(1/0)
debruine commented 2 years ago

These are great, thanks!