Skip to content
Snippets Groups Projects
Commit 8ca8029d authored by Adam Welc's avatar Adam Welc
Browse files

Fixed (temporarily) a problem with invoking "any" function on data frames.

parent 3f1220ab
No related branches found
No related tags found
No related merge requests found
# File src/library/base/R/dataframe.R
# Part of the R package, http://www.R-project.org
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# A copy of the GNU General Public License is available at
# http://www.r-project.org/Licenses/
# Statlib code by John Chambers, Bell Labs, 1994
# Changes Copyright (C) 1998-2014 The R Core Team
Summary.data.frame <- function(..., na.rm=FALSE)
{
args <- list(...)
args <- lapply(args, function(x) {
x <- as.matrix(x)
if(!is.numeric(x) && !is.complex(x))
stop("only defined on a data frame with all numeric variables")
x
})
do.call(.Generic, c(args, na.rm=na.rm))
}
......@@ -122,5 +122,7 @@ public class TestBuiltin_any extends TestBase {
assertEval(Ignored.Unknown, Output.ContainsWarning, "{ any(1) }");
// FIXME coercion warning missing
assertEval(Ignored.Unknown, Output.ContainsWarning, "{ any(0) }");
assertEval("{ d<-data.frame(c(1L,2L), c(10L, 20L)); any(d) }");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment