Skip to content
Snippets Groups Projects
Commit abbb9dc6 authored by Lukas Stadler's avatar Lukas Stadler
Browse files

remove overrides that are not necessary any more

parent 02753a4d
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))
}
# File src/library/utils/R/packages.R
# Part of the R package, http://www.R-project.org
#
# Copyright (C) 1995-2014 The R Core Team
#
# 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/
# An override that works around the problems with numeric version generic ops
# We have to eval this re-definition in the utils namespace environmment as it is a private function
# stored in a local map
eval(expression(
available_packages_filters_db$R_version <-
function(db)
{
## Ignore packages which don't fit our version of R.
depends <- db[, "Depends"]
depends[is.na(depends)] <- ""
## Collect the (versioned) R depends entries.
x <- lapply(strsplit(sub("^[[:space:]]*", "", depends),
"[[:space:]]*,[[:space:]]*"),
function(s) s[grepl("^R[[:space:]]*\\(", s)])
lens <- sapply(x, length)
pos <- which(lens > 0L)
if(!length(pos)) return(db)
lens <- lens[pos]
## Unlist.
x <- unlist(x)
pat <- "^R[[:space:]]*\\(([[<>=!]+)[[:space:]]+(.*)\\)[[:space:]]*"
## Extract ops.
ops <- sub(pat, "\\1", x)
## Split target versions accordings to ops.
v_t <- split(sub(pat, "\\2", x), ops)
## Current R version.
# v_c <- getRversion()
v_c <- as.character(getRversion())
## Compare current to target grouped by op.
res <- logical(length(x))
for(op in names(v_t))
res[ops == op] <- do.call(op, list(v_c, v_t[[op]]))
## And assemble test results according to the rows of db.
ind <- rep.int(TRUE, NROW(db))
ind[pos] <- sapply(split(res, rep.int(seq_along(lens), lens)), all)
db[ind, , drop = FALSE]
}), asNamespace("utils"))
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