The “is.infinite” Function in R

  • Package: Base R (no specific package required)

  • Purpose: Checks if values are infinite.

  • General Class: Data Inspection

  • Required Argument(s):

    • x: An R object, typically a numeric vector, whose elements are checked for being infinite.

  • Notable Optional Arguments:

    • None

  • Example:

  • # Example data for using the is.infinite function
    numeric_vector <- c(1, 2, Inf, 4, -Inf)

    # Use is.infinite to check for infinite values in a numeric vector
    infinite_result <- is.infinite(numeric_vector)

    # Display the result
    print(infinite_result)

  • In this example, the is.infinite function is used to check for infinite values in a numeric vector (numeric_vector). The resulting logical vector (infinite_result) indicates TRUE for positions where the values are infinite and FALSE where values are not infinite. The is.infinite function is commonly used for identifying and handling infinite values in numerical data.

Previous
Previous

The “is.finite” Function in R

Next
Next

The “is.nan” Function in R