I am trying to debug and check why some rows on a data frame contain Inf values.
blah <- data.frame(
x = 1:10,
y = c(1:7,Inf,9:10),
z = c(Inf, 2:10)
)
Tried:
blah %>% filter_if(is.infinite)
Error in selected[[i]] <- eval_tidy(.p(column, ...)) :
more elements supplied than there are to replace
Desired result is a new data frame with the rows that contain Inf values, in the case of blah, rows 1 and 8.
How can I filter a data frame to return all rows where any of them contain Inf?