View | Details | Raw Unified | Return to bug 17118
Collapse All | Expand All

(-)sapply.R (-2 / +2 lines)
Lines 1-7 Link Here
1
#  File src/library/base/R/sapply.R
1
#  File src/library/base/R/sapply.R
2
#  Part of the R package, https://www.R-project.org
2
#  Part of the R package, https://www.R-project.org
3
#
3
#
4
#  Copyright (C) 1995-2015 The R Core Team
4
#  Copyright (C) 1995-2016 The R Core Team
5
#
5
#
6
#  This program is free software; you can redistribute it and/or modify
6
#  This program is free software; you can redistribute it and/or modify
7
#  it under the terms of the GNU General Public License as published by
7
#  it under the terms of the GNU General Public License as published by
Lines 33-39 Link Here
33
    else if(common.len > 1L) {
33
    else if(common.len > 1L) {
34
        n <- length(x)
34
        n <- length(x)
35
        ## make sure that array(*) will not call rep() {e.g. for 'call's}:
35
        ## make sure that array(*) will not call rep() {e.g. for 'call's}:
36
        r <- as.vector(unlist(x, recursive = FALSE))
36
        r <- unlist(x, recursive = FALSE, use.names = FALSE)
37
        if(higher && length(c.dim <- unique(lapply(x, dim))) == 1 &&
37
        if(higher && length(c.dim <- unique(lapply(x, dim))) == 1 &&
38
           is.numeric(c.dim <- c.dim[[1L]]) &&
38
           is.numeric(c.dim <- c.dim[[1L]]) &&
39
           prod(d <- c(c.dim, n)) == length(r)) {
39
           prod(d <- c(c.dim, n)) == length(r)) {

Return to bug 17118