Skip to content

Commit

Permalink
changed error message from elements to columns as discussed in tidyve…
Browse files Browse the repository at this point in the history
  • Loading branch information
Holger Brandl committed Jul 16, 2015
1 parent bf8fae1 commit 7315728
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/dataframe.R
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-data_frame.R
Expand Up @@ -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" )
})

0 comments on commit 7315728

Please sign in to comment.