Closed mpadge closed 1 year ago
Rcpp::CharacterVector was silently converting user-provided numeric and integer values to character. Now the functions break when given numeric values.
If it's only used as an entry point into C++ functions, then you could just pass paste0(x)
through to C++?
Yes I think it is.
Why paste0(x)
rather than as.character(x)
?
Isn't that more costly than a C++ solution or banning numerical values?
As a user, I do pass mixtures of decimal degree and sexagesimal degree values in character vectors so some time is lost processing strings that are already in decimal degree and would successfully converted using as.numeric()
.
But this is a character vector, why would the user need to pass a numeric vector to parse_lon()
?
I can see a user case for passing lat and lon numeric vectors to parse_hemisphere()
but this is so much slower than 2 if()
statements.
And then just manipulate std::vector objects in all functions, without any Rcpp