Re: [Rd] Why is any() only defined for a numeric and not logical data.frame?

2020-02-16 Thread Rui Barradas
Hello, As it turns out, this is valid for all generics of the ?Summary group. From help("Summary"): Group "Summary": all, any sum, prod min, max range methods("Summary") shows that there is a method for df's. And the code of Summary.data.frame has an explicit test if

[Rd] Why is any() only defined for a numeric and not logical data.frame?

2020-02-16 Thread Karolis Koncevičius
Hello, I recently stumbled on an unusual behaviour of any() and all() and have been adviced from StackOverflow to share it here [1]. df1 <- data.frame(A=TRUE, B=FALSE) df2 <- data.frame(A=1, B=0) > any(df1) Error in FUN(X[[i]], ...): only defined on a data frame with