From 7315728ce81e7b9bc0a052100b0191aa5ec9c7d0 Mon Sep 17 00:00:00 2001 From: Holger Brandl Date: Thu, 16 Jul 2015 13:17:08 +0200 Subject: [PATCH] changed error message from elements to columns as discussed in https://github.com/hadley/dplyr/issues/1101 --- R/dataframe.R | 2 +- tests/testthat/test-data_frame.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/dataframe.R b/R/dataframe.R index b4e76806f..8f6f46809 100644 --- a/R/dataframe.R +++ b/R/dataframe.R @@ -132,7 +132,7 @@ as_data_frame <- function(x) { names_x <- names2(x) if (any(is.na(names_x) | names_x == "")){ - stop("All elements must be named", call. = FALSE) + stop("All columns must be named", call. = FALSE) } ok <- vapply(x, is_1d, logical(1)) diff --git a/tests/testthat/test-data_frame.R b/tests/testthat/test-data_frame.R index e99c2a1ea..c186e87e0 100644 --- a/tests/testthat/test-data_frame.R +++ b/tests/testthat/test-data_frame.R @@ -53,5 +53,5 @@ test_that("Zero column list makes 0 x 0 tbl_df", { test_that("error on NA column names (#1101)", { df <- data.frame( x = 1:10, y = 1:10 ) names(df)[1] <- NA - expect_error( as_data_frame(df), "All elements must be named" ) + expect_error( as_data_frame(df), "All columns must be named" ) })