Re: [R] misbehavior with extract_numeric() from tidyr

2015-04-20 Thread Hadley Wickham
On Mon, Apr 20, 2015 at 1:57 PM, arnaud gaboury wrote: > On Mon, Apr 20, 2015 at 6:09 PM, William Dunlap wrote: > >> The hyphen without a following digit confuses tidyr::extract_numeric(). >> E.g., >>> extract_numeric("23 ft-lbs") >>Warning message: >>In extract_numeric("23 ft-lbs") :

Re: [R] misbehavior with extract_numeric() from tidyr

2015-04-20 Thread arnaud gaboury
On Mon, Apr 20, 2015 at 6:09 PM, William Dunlap wrote: > The hyphen without a following digit confuses tidyr::extract_numeric(). > E.g., >> extract_numeric("23 ft-lbs") >Warning message: >In extract_numeric("23 ft-lbs") : NAs introduced by coercion >[1] NA >> extract_numeric("

Re: [R] misbehavior with extract_numeric() from tidyr

2015-04-20 Thread William Dunlap
The hyphen without a following digit confuses tidyr::extract_numeric(). E.g., > extract_numeric("23 ft-lbs") Warning message: In extract_numeric("23 ft-lbs") : NAs introduced by coercion [1] NA > extract_numeric("23 ft*lbs") [1] 23 Contact the BugReports address for the package

Re: [R] misbehavior with extract_numeric() from tidyr

2015-04-20 Thread arnaud gaboury
On Mon, Apr 20, 2015 at 12:09 PM, Jim Lemon wrote: > Hi arnaud, > At a guess, it is the two hyphens that are present in those strings. I > think that the function you are using interprets them as subtraction > operators and since the string following the hyphen would produce NA, > the result would

Re: [R] misbehavior with extract_numeric() from tidyr

2015-04-20 Thread Jim Lemon
Hi arnaud, At a guess, it is the two hyphens that are present in those strings. I think that the function you are using interprets them as subtraction operators and since the string following the hyphen would produce NA, the result would be NA. Jim On Mon, Apr 20, 2015 at 7:46 PM, arnaud gaboury

Re: [R] misbehavior with extract_numeric() from tidyr

2015-04-20 Thread arnaud gaboury
On Mon, Apr 20, 2015 at 9:10 AM, arnaud gaboury wrote: > R 3.2.0 on Linux > > > library(tidyr) > > playerStats <- c("LVL 10", "5,671,448 AP l6,000,000 AP", "Unique > Portals Visited 1,038", > "XM Collected 15,327,123 XM", "Hacks 14,268", "Resonators Deployed 11,126