I have a vector I'm trying to convert from character to numeric. I've isolated it into the following. Any idea what is going on? Why is this 'number' or character sequence of '1,257.15' doing this? I'm uploading a data set of 8,000 rows and about 50 are producing an error when doing as.numeric()
or as.numeric_version
.
as.numeric(as.character('1,257.15'))
[1] NA
Warning message:
NAs introduced by coercion
traceback()
3: stop(gettextf("invalid version specification %s", paste(sQuote(unique(x[!ok])),
collapse = ", ")), call. = FALSE, domain = NA)
2: .make_numeric_version(x, strict, .standard_regexps()$valid_numeric_version)
1: numeric_version(as.character("1,256.15"))
numeric_version(as.character('1,256.15'))
Error: invalid version specification ‘1,256.15’
Then I tried this.
numericDeriv(as.character('1,257.15'))
Error in rep_len(dir, length(theta)) :
argument "theta" is missing, with no default