Skip to content

Commit

Permalink
don't stop() if there are unmatched column types
Browse files Browse the repository at this point in the history
  • Loading branch information
alyst committed May 4, 2015
1 parent 518546a commit 9c6502c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
* When guessing field types, and there's no information to go on, use
character instead of logical (#124, #128).

* `read_XXX()` methods would not throw an error if `col_types` argument
specifies type for a missing column (#145 thanks @alyst).

8 changes: 4 additions & 4 deletions R/col_types.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ col_types_full <- function(col_types, col_names, guessed_types) {

col_types
} else {
bad_names <- setdiff(names(col_types), col_names)
if (length(bad_names) > 0) {
stop("The following named parsers don't match the column names: ",
paste0(bad_names, collapse = ", "), call. = FALSE)
unmatched_names <- setdiff(names(col_types), col_names)
if (length(unmatched_names) > 0) {
warning("The following named parsers don't match the column names: ",
paste0(unmatched_names, collapse = ", "), call. = FALSE)
}

skip <- setdiff(col_names, names(col_types))
Expand Down

0 comments on commit 9c6502c

Please sign in to comment.