Displaying 2 results from an estimated 2 matches for "encodereal".
2009 May 23
2
as.numeric(levels(factor(x))) may be a decreasing sequence
...= *(p++)) {
+ ;
+ }
+ break;
+ }
+ }
+ return s;
+}
+
SEXP attribute_hidden StringFromReal(double x, int *warn)
{
int w, d, e;
formatReal(&x, 1, &w, &d, &e, 0);
if (ISNA(x)) return NA_STRING;
- else return mkChar(EncodeReal(x, w, d, e, OutDec));
+ else return mkChar(elim_trailing(EncodeReal(x, w, d, e, OutDec), OutDec));
}
SEXP attribute_hidden StringFromComplex(Rcomplex x, int *warn)
2005 Apr 17
3
RFC: hexadecimal constants and decimal points
...lemented assuming LC_NUMERIC=C. I would hope to
continue to have `dec' but perhaps with a locale-dependent default.) The
resulting asymmetry (R would not be able to parse its own output) would be
unhappy, but seems inevitable. (This could be implemented easily by having
a `dec' arg to EncodeReal and EncodeComplex, and using LC_NUMERIC to
control that rather than actually setting the local category. For
example, deparsing needs to be done in LC_NUMERIC=C.)
All of these could be implemented by customized versions of
strtod/strtol.
--
Brian D. Ripley, ripley@stats.ox...