Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NA parameter ignored for read_tsv since 2.0.0 #1258

Closed
sbachstein opened this issue Aug 2, 2021 · 1 comment
Closed

NA parameter ignored for read_tsv since 2.0.0 #1258

sbachstein opened this issue Aug 2, 2021 · 1 comment

Comments

@sbachstein
Copy link

Since version 2.0.0 the na parameter is ignored entirely for read_tsv.

Input test.csv:

A,B,C
:,k,l
m,:,n

Command:
readr::read_csv('test.csv', na = c(":"))

Output (as expected):

Rows: 2 Columns: 3                                                                                                 
── Column specification ────────────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
chr (3): A, B, C

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# A tibble: 2 x 3
  A     B     C    
  <chr> <chr> <chr>
1 NA    k     l    
2 m     NA    n

On the other hand

Input test.tsv:

A	B	C
:	k	l
m	:	n

Command:
readr::read_tsv('test.tsv', na = c(":"))

Output (no NA replacements):

Rows: 2 Columns: 3                                                                                                 
── Column specification ────────────────────────────────────────────────────────────────────────────────────────────────
Delimiter: "\t"
chr (3): A, B, C

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# A tibble: 2 x 3
  A     B     C    
  <chr> <chr> <chr>
1 :     k     l    
2 m     :     n 
@jimhester
Copy link
Collaborator

Duplicate of #1255, this is already fixed in the development version of readr.

AB-Kent added a commit to akoyabio/phenoptr that referenced this issue Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants