-
Notifications
You must be signed in to change notification settings - Fork 291
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior
Description
When using read_csv to read a CSV file that contains tabs on its rows, the trim_ws argument does not seem to have any effect. The tab characters do not get stripped anyway.
Take this CSV file for example
X,Y
x1,y1
x2 ,y2
x3,y3
x4,y4
There is a tab after x2 and after y3 (not visible). And the code below demonstrates the issue
> data <- read_csv("test.csv", trim_ws = TRUE, col_types = "cc")
> data[, 1]
# A tibble: 4 x 1
X
<chr>
1 x1
2 "x2\t"
3 x3
4 x4
> data[, 2]
# A tibble: 4 x 1
Y
<chr>
1 y1
2 y2
3 "y3\t"
4 y4
As you can see the tab characters are there and not trimmed.
I'm running the code using R 3.3.3 and readr 1.1.1. on macOS High Sierra.
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior