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

extract_numeric returns positive on negative numbers #20

Closed
barryrowlingson opened this issue Aug 14, 2014 · 1 comment
Closed

extract_numeric returns positive on negative numbers #20

barryrowlingson opened this issue Aug 14, 2014 · 1 comment

Comments

@barryrowlingson
Copy link

extract_numeric("-123") returns 123, because all it does is strip anything not 0-9 or decimal point.

Its documentation is pretty thin too.

discussion here:
http://stackoverflow.com/questions/25291191/can-extract-numeric-deal-with-negative-numbers

@hadley hadley closed this as completed in 633984d Aug 22, 2014
@gabx
Copy link

gabx commented Apr 20, 2015

extract_numeric("23 ft-lbs")
[1] NA
Warning message:
In extract_numeric("23 ft-lbs") : NAs introduced by coercion
The minus sign in the regex is maybe good for "-123" but leads to errors too.

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