Skip to content

Commit

Permalink
Support logical types in as.character(col_spec) as well
Browse files Browse the repository at this point in the history
Fixes #1127
  • Loading branch information
jimhester committed Sep 30, 2020
1 parent e36b94d commit b020ea1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

## Additional features and fixes

* `as.character.col_spec()` now handles logical columns as well (#1127)

* The cli package is now used for all messages.

* Compressed files are now detected by magic numbers rather than by the file extension (#1125)
Expand Down
11 changes: 6 additions & 5 deletions R/col_types.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,16 @@ as.col_spec.data.frame <- function(x) {

col_to_short <- function(x, ...) {
switch(class(x)[[1]],
collector_skip = "-",
collector_guess = "?",
collector_character = "c",
collector_factor = "f",
collector_date = "D",
collector_datetime = "T",
collector_double = "d",
collector_factor = "f",
collector_guess = "?",
collector_integer = "i",
collector_logical = "l",
collector_number = "n",
collector_date = "D",
collector_datetime = "T",
collector_skip = "-",
collector_time = "t"
)
}
Expand Down

0 comments on commit b020ea1

Please sign in to comment.