search for: r_print

Displaying 12 results from an estimated 12 matches for "r_print".

Did you mean: g_print
2003 May 02
2
Suppressing Scientific Notation
...ers for "normal" printing and *m is the number of characters for scientific notation. If mf <= *m, then parameters are set that cause "normal" printing. My idea was to introduce a "penalty" for scientific notation, which changes line 286 to: if (mF <= *m + R_print.scipen) { R_print.scipen is an integer (defaulting to 0) set with "options": R> options(scipen=99) I tried to copy the code for R_print.digits (as in "options(digits=7)") wherever I found it, notably in the struct "R_print_par_t" defined in Print.h. I changed ma...
2015 Jun 13
2
Lack of protection bug in current R release candidate
The current R release candidate has a lack of protect bug (of very long standing) with respect to the R_print.na_string and R_print.na_string_noquote fields of the static R_print structure declared in Print.h. This shows up very occassionally as incorrect output from the following lines in reg-tests-2.R: x <- c("a", NA, "b") factor(x) factor(x, exclude="") The solu...
2003 Jan 29
1
printing reals from C with digits
...al numbers in C code with different values for digits. How to do that? As I have understood, what I should do is to call StringFromReal() which calls FormatReal(), that one suggests the parameters (width, decimal places and exponential form). FormatReal() includes eps = pow(10.0, -(double)R_print.digits); So I guess I have to change the value of R_print.digits. R_print.digits is defined in include/Print.h in the package source, but unfortunately the installed version (in /usr/lib/R/include/R_ext) is quite a different. I guess that is because the structure is not meant to be accessible by...
2015 Jun 15
0
Lack of protection bug in current R release candidate
...> Radford Neal <radford at cs.toronto.edu> >>>>> on Sat, 13 Jun 2015 17:24:04 -0400 writes: > The current R release candidate has a lack of protect bug > (of very long standing) [ but not really reported, right ? ] > with respect to the > R_print.na_string and R_print.na_string_noquote fields of > the static R_print structure declared in Print.h. This > shows up very occassionally as incorrect output from the > following lines in reg-tests-2.R: > x <- c("a", NA, "b") > factor(x)...
2017 Nov 09
1
formatting raw vectors with names
...deRaw does not honor the requested width, in fact it doesn?t even get the width as a parameter. An easy fix would be to change: static void printNamedRawVector(Rbyte * x, int n, SEXP * names) PRINT_N_VECTOR(formatRaw(x, n, &w), Rprintf("%s%*s", EncodeRaw(x[k], ""), R_print.gap,"")) to static void printNamedRawVector(Rbyte * x, int n, SEXP * names) PRINT_N_VECTOR(formatRaw(x, n, &w), Rprintf("%*s%s%*s", w - 2, "", EncodeRaw(x[k], ""), R_print.gap,"")) in printvector.c:314. - Lukas
2016 Mar 18
1
formatting of complex matrix
...1 1 1 1 1 1 1 1 1 1 1 1 1 [2,] 1 1 1 1 1 1 1 1 1 1 1 1 1 The problem seems to be in printarray.c:275 (https://github.com/wch/r-source/blob/trunk/src/main/printarray.c#L275): EncodeComplex(x[i + j * r], wr[j] + R_print.gap, dr[j], er[j], wi[j], di[j], ei[j], OutDec)) ) The width of the real part wr[j] + the width of the imaginary part wi[j] + R_print.gap doesn?t always add up to the width of the column w[j]. As far as we can see, calculating the width of the real part on the fly fixes the problem: EncodeCom...
2003 Feb 02
1
printing reals from C with digits -- once more
...hould do is to call | > | > StringFromReal() | | That's a coercion, not a printing routine. | | > which calls FormatReal(), that one suggests the parameters (width, | > decimal places and exponential form). FormatReal() includes | > | > eps = pow(10.0, -(double)R_print.digits); | > | > So I guess I have to change the value of R_print.digits. | > R_print.digits is defined in include/Print.h in the package source, | > but unfortunately the installed version (in /usr/lib/R/include/R_ext) is | > quite a different. | | R_ext/Print.h and Print.h...
2002 Aug 13
2
Misalignment of <NA> in rownames (PR#1905)
...Label and MatrixColumnLabel (same file) rely on Rstrlen to count the characters in each label, but Rstrlen doesn't understand NA's. Here's a patch, to be applied between lines 242 ("int len;") and 243 ("len = 0;"): if (s == CHAR(NA_STRING)) return quote ? R_print.na_width : R_print.na_width_noquote; which solves the problem: R-patched> x A B C D a 1 4 7 10 <NA> 2 5 8 11 c 3 6 9 12 ----------------------------------------------------------------------------- An NA in the colnames has similar misalignment problems: R> x <- matr...
1999 Oct 13
1
formatReal()-bug (or Is there anybody out there w/o IEEE754?)
...is NA: 1. (format.c:235) if (!R_FINITE ..) gives nanflag=1 (!naflag remains 0) 2. (format.c:272..288) *m gets an value of -2147483643 (from the format fiddling, should not matter to us) 3. (format.c:289) because naflag is zero, m does not get the value of R_print.na_width and we get back the unbelievable value from 2. This crashes R in commands as as.vector(NA,mode="double") . (Please reply to my mail address too, because I do not read r-devel regularly). -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-....
2012 Mar 13
0
111 FIXMEs in main/src
...w ]]\n", -- printarray.c: if(r_pr < r) /* FIXME? use _P() and "Defn.h" ? */ printarray.c- Rprintf(" [ reached getOption(\"max.print\") -- omitted %d rows ]]\n", -- print.c: * <FIXME> These routines are not re-entrant: they reset the print.c- * global R_print. -- print.c:/* FIXME : We need a general mechanism for "rendering" symbols. */ print.c-/* It should make sure that it quotes when there are special */ -- print.c: /* FIXME: check (ns <= R_print.max +1) ? ns : R_print.max; */ print.c- for (i = 0; i < ns; i++) { -- printutils.c:/* &lt...
2011 Feb 05
2
print(...,digits=2) behavior
A bug was recently posted to the R bug database (which probably would better have been posted as a query here) as to why this happens: > print(7.921,digits=2) [1] 8 > print(7.92,digits=2) [1] 7.9 Two things I *haven't* done to help make sense of this for myself are (1) writing out the binary representations to see if something obvious pops out about why this would be a breakpoint and
2011 Feb 05
2
print(...,digits=2) behavior
A bug was recently posted to the R bug database (which probably would better have been posted as a query here) as to why this happens: > print(7.921,digits=2) [1] 8 > print(7.92,digits=2) [1] 7.9 Two things I *haven't* done to help make sense of this for myself are (1) writing out the binary representations to see if something obvious pops out about why this would be a breakpoint and