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

read_csv coerces character column to double, but no NA? #299

Closed
icj opened this issue Oct 23, 2015 · 2 comments
Closed

read_csv coerces character column to double, but no NA? #299

icj opened this issue Oct 23, 2015 · 2 comments

Comments

@icj
Copy link

icj commented Oct 23, 2015

In readr 0.1.1, read_csv does the following:

# with readr 0.1.1
file <- "X1\n1\n2\n2X"
read_csv(file)

# Source: local data frame [3 x 1]
# 
#      X1
#   (chr)
#1     1
#2     2
#3    2X

But in readr 0.2.2, read_csv does something unexpected:

# with readr 0.2.2
file <- "X1\n1\n2\n2X"
read_csv(file)

# Source: local data frame [3 x 1]
# 
#      X1
#   (dbl)
#1     1
#2     2
#3     2

Seems like the 2X should have been NA if it thought it was a numeric column. Subbing it to 2 could be dangerous.

@hadley
Copy link
Member

hadley commented Oct 23, 2015

Hmmm, the numeric guesser is being too aggressive. I'll have another look at it.

@hadley
Copy link
Member

hadley commented Jun 2, 2016

Duplicate of #308

@hadley hadley closed this as completed Jun 2, 2016
@lock lock bot locked and limited conversation to collaborators Sep 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants