Conditions related to finite values

row_finites(.data, match_type = "none", ...)

# S3 method for matrix
row_finites(.data, match_type = "none", ...)

# S3 method for data.frame
row_finites(.data, match_type = "none", ...)

Arguments

.data

A two-dimensional data structure.

match_type

One of ("all", "any", "none", "which_first", "count"). Possibly abbreviated.

...

Arguments passed on to op_ctrl

output_class

One of ("vector", "list", "data.frame", "matrix"), possibly abbreviated.

cols

A vector indicating which columns to consider for the operation. If NULL, all columns are used. If its length is 0, no columns are considered. Negative numbers, logical values, character vectors representing column names, and tidyselect::select_helpers are supported.

rows

Like cols but for row indices, and without tidyselect support.

Examples

# consistency with R with respect to NA/NaN df <- data.frame(NaN, NA_real_, NA_complex_, NA_integer_, NA_character_, NA) sapply(df, is.finite)
#> NaN. NA_real_. NA_complex_. NA_integer_. NA_character_. #> FALSE FALSE FALSE FALSE FALSE #> NA. #> FALSE
row_finites(df, "none")
#> [1] TRUE
# complex also supported mat <- matrix(as.complex(Inf), nrow = 2L, ncol = 2L) mat[1L] <- 0+0i row_finites(mat, "any")
#> [1] TRUE FALSE