Displaying 20 results from an estimated 2000 matches similar to: "printing reals from C with digits"
2003 Feb 02
1
printing reals from C with digits -- once more
Thank for Brian D. Ripley for the answer to my previous question.
My aim is to print single values from different real vectors with
different digits option. This is quite a possible with Rprintf() but
that one supprots printing format as C does, not in R native way
(setting digits=7 or printing with "%12.7f" are two quite different
things). So I would like to find something more
1999 Oct 13
1
formatReal()-bug (or Is there anybody out there w/o IEEE754?)
On a system with IEEE_754 undefined, I run into an bug, when the value
of an element of the first argument (e.g., x[0]) of formatReal() 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
2009 May 23
2
as.numeric(levels(factor(x))) may be a decreasing sequence
Function factor() in the current development version (2009-05-22)
guarantees that levels are different character strings. However, they
may represent the same decimal number. The following example is derived
from a posting by Stavros Macrakis in thread "Match .3 in a sequence"
in March
nums <- 0.3 + 2e-16 * c(-2,-1,1,2)
f <- factor(nums)
levels(f)
# [1]
2003 May 02
2
Suppressing Scientific Notation
R gurus,
Every so often(*) someone asks how to suppress scientific notation in
printing, so I thought I'd give it a shot, but I need some help.
The formatting decision is made(**) on line 286 of src/main/format.c :
if (mF <= *m) { /* IFF it needs less space : "F" (Fixpoint) format */
where mF is the number of characters for "normal" printing and *m is the number
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="")
2017 Nov 09
1
formatting raw vectors with names
I think there?s a bug concerning the formatting of raw vectors with names:
> structure(as.raw(1:3), .Names = c("a", "bbbb", "c"))
a bbbb c
01 02 03
> structure(1:3, .Names = c("a", "bbbb", "c"))
a bbbb c
1 2 3
The problem is that EncodeRaw does not honor the requested width, in fact it doesn?t even get the
2016 Mar 18
1
formatting of complex matrix
While working on the printing code, my colleague Zbyn?k ?lajchrt noticed that complex matrixes are sometimes misaligned:
> { matrix(1i,2,13) }
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i
[2,] 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i
(the values in the last four columns
2019 Apr 05
2
Parsing code with newlines
Hello!
This is my first post here. I came across the very same problem.
It can be reproduced within modified tests/Embedding/RParseEval.c
Actually this example has another issue, namely it doesn't wrap
everything in R_ToplevelExec . This is a major show stopper for
newcomers as that function is barely mentioned anywhere and longjmp into
terminated setuploop function followed by R_suicide
2007 Apr 07
2
Rf_PrintValue problem with methods::show
Hi,
I think this is a bug (even though I can't find documentation
explicitly saying that it should work). Basically, Rf_PrintValue(obj)
fails when 'obj' is an S4 object that should be printed using show()
rather than print(). From the error message I'm guessing that the need
to use show is detected correctly but then show is not found.
"cbind2" in the code below is just
2008 Apr 29
2
Calling R from C - part way there but need a push!
Dear All,
I've read the manual on "Writing R Extensions" and in particular the
part on calling R from C. (Most of the manual is about calling C
from R, not the other way around.)
The good news is that I can now call _some_ R from C, specifically
the R functions which have C header files. However it isn't clear to
me how to call R functions that are written in R. I
2002 Aug 13
2
Misalignment of <NA> in rownames (PR#1905)
An NA in the rownames of a matrix (or dataframe) causes misalignment when the
matrix is printed:
R> x <- matrix(1:12, 3,4, dimnames=list(letters[1:3], LETTERS[1:4]))
R> rownames(x)[2] <- NA
R> x
A B C D
a 1 4 7 10
<NA> 2 5 8 11
c 3 6 9 12
The bug is in function Rstrlen, in src/main/printutils.c. MatrixRowLabel and
MatrixColumnLabel (same file) rely on Rstrlen
2013 Aug 15
1
format bug and patch
Dear R-team,
I've been using R for a while and decided to contribute some bug
fixes. The first bug I tried to solve was
https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15411
I have attached a patch with the fix to the bug and would love to hear
comments about its quality.
Also, while testing this bug I found another related issue:
> format(complex(real=10, imaginary=4), digits = 1);
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
2011 Oct 28
2
[LLVMdev] [LLVM, llvm-diff] Question about FunctionDifferenceEngine and DiffConsumer::printValue
Hi all.
I found next code when switch instruction differs:
Engine.logf("right switch has extra case %r") << CaseValue;
Where CaseValue is a ConstantInt object. Looking how logf works I found
that it invokes DiffConsumer::printValue method for CaseValue. And here
I found that CaseValue itself will never printed. On first look how
DiffConsumer::printValue works it seems that for
2011 Oct 31
3
[LLVMdev] [LLVM, llvm-diff] Question about FunctionDifferenceEngine and DiffConsumer::printValue
Hi,
Please find the attached patch for review.
-Stepan.
John McCall wrote:
> On Oct 28, 2011, at 2:00 AM, Stepan Dyatkovskiy wrote:
>> I found next code when switch instruction differs:
>>
>> Engine.logf("right switch has extra case %r")<< CaseValue;
>>
>> Where CaseValue is a ConstantInt object. Looking how logf works I found
>> that it
2009 Feb 22
4
'unique' error message is printed despite silent=TRUE (PR#13547)
In 2.8.0/Windows Vista:
When 'unique' gives a type error message, it prints out even if errors
are being caught:
> try(unique(quote(hello)),silent=TRUE)
hello
This comes from the .Internal unique routine:
> try(.Internal(unique(quote(hello),NULL,NULL)),silent=TRUE)
hello
I guess it is using the internal equivalent of print rather than the
internal equivalent of stop.
2011 Oct 29
0
[LLVMdev] [LLVM, llvm-diff] Question about FunctionDifferenceEngine and DiffConsumer::printValue
On Oct 28, 2011, at 2:00 AM, Stepan Dyatkovskiy wrote:
> I found next code when switch instruction differs:
>
> Engine.logf("right switch has extra case %r") << CaseValue;
>
> Where CaseValue is a ConstantInt object. Looking how logf works I found
> that it invokes DiffConsumer::printValue method for CaseValue. And here
> I found that CaseValue itself will
2011 Nov 03
0
[LLVMdev] [LLVM, llvm-diff] Question about FunctionDifferenceEngine and DiffConsumer::printValue
ping.
-Stepan.
Stepan Dyatkovskiy wrote:
> Hi,
>
> Please find the attached patch for review.
>
> -Stepan.
>
> John McCall wrote:
>> On Oct 28, 2011, at 2:00 AM, Stepan Dyatkovskiy wrote:
>>> I found next code when switch instruction differs:
>>>
>>> Engine.logf("right switch has extra case %r")<< CaseValue;
>>>
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