Re: [Rd] Development version of R fails tests and is not installed
G'day Jeroen, On Sun, 9 Feb 2020 01:04:24 +0100 Jeroen Ooms wrote: > I think the intention was to add something similar in R's autoconf > script to enable sse on 32-bit unix systems, but seemingly this hasn't > happened. For now I think you should be able to make your 32-bit > checks succeed if you build R with CFLAGS=-mfpmath=sse -msse2. Just for the record, adding CFLAGS="-mfpmath=sse -msse2" to the config.site file used to compile the 32bit version of R's development version fixed the problem indeed. The installation script ran from the command line with out error to the end, and every day since then at this crontab'd time. Looks as if it would be good indeed if R's autoconf script would enable sse on 32-bit unix systems. :) Thank you for the solution. Cheers, Berwin __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Why is any() only defined for a numeric and not logical data.frame?
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 all numeric variables > any(df2) [1] TRUE Warning message: In any(c(1, 2), na.rm = FALSE): coercing argument of type 'double' to logical Same results happen when using all() So the any() and all() do not work on data frames with logical values, but work if the values are numeric. This doesn't seem to be a bug because error correctly states that any() will only work on an all-numeric data.frame. However the behaviour doesn't seem intentional and I cannot come up with any reason for it behaving this way. Maybe any() and all() need to be modified to not work on data.frames() at all, which would also be consistent with is.nan() ? [1]: https://stackoverflow.com/questions/60251847/why-is-any-only-defined-for-a-numeric-and-not-logical-data-frame __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Why is any() only defined for a numeric and not logical data.frame?
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 (!is.numeric(x) && !is.complex(x)) stop("only defined on a data frame with all numeric variables") So now the question is even more pertinent (?)(I think): If sum() is a valid instruction, why only sum() sum() are valid? Rui Barradas Às 19:23 de 16/02/20, Karolis Koncevičius escreveu: 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 all numeric variables > any(df2) [1] TRUE Warning message: In any(c(1, 2), na.rm = FALSE): coercing argument of type 'double' to logical Same results happen when using all() So the any() and all() do not work on data frames with logical values, but work if the values are numeric. This doesn't seem to be a bug because error correctly states that any() will only work on an all-numeric data.frame. However the behaviour doesn't seem intentional and I cannot come up with any reason for it behaving this way. Maybe any() and all() need to be modified to not work on data.frames() at all, which would also be consistent with is.nan() ? [1]: https://stackoverflow.com/questions/60251847/why-is-any-only-defined-for-a-numeric-and-not-logical-data-frame __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel