diff -u 20161017/table.R 20161017_new/table.R --- 20161017/table.R 2016-10-17 23:02:55.890625000 +0700 +++ 20161017_new/table.R 2016-10-17 23:07:01.375000000 +0700 @@ -52,7 +52,7 @@ stop("nothing to tabulate") if (length(args) == 1L && is.list(args[[1L]])) { ## e.g. a data.frame args <- args[[1L]] - if (length(dnn) != length(args)) + if (missing(dnn) || length(dnn) != length(args)) dnn <- if (!is.null(argn <- names(args))) argn else paste(dnn[1L], seq_along(args), sep = ".") } diff -u 20161017/xtabs.R 20161017_new/xtabs.R --- 20161017/xtabs.R 2016-10-17 23:02:41.906250000 +0700 +++ 20161017_new/xtabs.R 2016-10-17 23:05:38.203125000 +0700 @@ -1,7 +1,7 @@ # File src/library/stats/R/xtabs.R # Part of the R package, https://www.R-project.org # -# Copyright (C) 1995-2015 The R Core Team +# Copyright (C) 1995-2016 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 @@ -58,7 +58,7 @@ if(!sparse) { x <- if(is.null(y)) - do.call("table", by) + table(by) else if(NCOL(y) == 1L) tapply(y, by, sum) else {