Displaying 20 results from an estimated 4000 matches similar to: "formatC with format="fg" displays number in exponential notation (PR#2299)"
1999 Feb 28
0
Formatting in formatC and format (PR#129)
[This turned into a bug report which will go to r-devel, so I have taken it
off r-help.]
Bugs reported here:
(1) formatC's help page need some clarification.
(2) formatC needs to treat modes "double" and "real" as equivalent.
(3) format's help page or (preferably) format needs correction re the
meaning of `digits'
On Sun, 28 Feb 1999, Martin Maechler wrote:
2008 Jun 09
1
Bug/Error in formatC? (Was: Why doesn't formatC( x, digits=2, format= "g")...)
Hi all
After posting what follows, Duncan Murdoch suggested perhaps a bug
in formatC, or an error on documentation. Any comments?
In particular, bug, error or not, any ideas about how I can
consistently get two significant figures to print?
P.
---------- Original Message ----------
Hi all
I am not a C programmer, but I am trying to understand formatC to
get consistent printing of
2008 Jun 06
2
Why doesn't formatC( x, digits=2, format="g") doesn't always give 2 sig figs?
Hi all
I am not a C programmer, but I am trying to understand formatC to
get consistent printing of reals to a given number of significant
digits.
Can someone please explain this to me? These first three give what
I expect on reading ?formatC:
> formatC(0.0059999, digits=2,format="fg",flag="#")
[1] "0.0060"
> formatC(0.59999,
2002 Jul 03
2
Scientific notation
I'm writing a load of output to a file using cat(...), but I can't work out
how to turn off scientific notation for small numbers. When I originally
tried this a while a go I ended up building up a string variable, which is
rather clumsy...
Many thanks,
David
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2019 May 30
1
Possible bug in formatC
I do not know if this is a bug or a case of improper documentation. The
documentation for formatC() implies that the difference between the options
format="f" and format="g" is that with "g", scientific format is sometimes
used. There is another difference between them that is not mentioned in the
documentation. drop0trailing=FALSE is ignored when format is set to
2000 Jan 04
0
formatC (bug and fix) (PR#394)
OK:
> formatC(as.double(c(1,0,NA)))
[1] "1" "0" "NA"
NOT OK:
> formatC(as.integer(c(1,0,NA)))
[1] "0" "1072693248" "NA"
> formatC(as.integer(c(0,1,NA)))
[1] "0" "0" "NA"
BUG TRACED TO R-code of formatC()
where
x[!Ok] <- 0
unintendedly changes the storage.mode of x to
1997 Jun 30
0
R-beta: Color specifications -- simple 'bg' / 'fg' swapping -- proposal
Consider the following example :
data(iris)
attach(iris)
par(bg = 'midnightblue', fg = 'yellow')
plot(Petal.Length, Petal.Width, main = "Fisher's iris data", sub = "3 kinds")
##>>> gives black axis labels and titles ...
## Currently, the plot I want is produced by
par(bg = 'midnightblue', fg = 'yellow', col.axis='yellow',
2001 Oct 26
1
Bug or new concept in formatC?
As a sequel to my previous mail on cut, formatC does not produce
what I have been taught is significant digits:
> x <- c(1.0793,1.0796, 11.0954, 11.0736 )
> formatC(x,digits=3,format="g")
[1] "1.08" "1.08" "11.1" "11.1"
(3,3,3,3) significant digits OK
> formatC(x,digits=3,format="f")
[1] "1.079"
2009 Jan 27
1
small bug in base::formatC (PR#13474)
Full_Name: Bernd Bischl
Version: 2.8.1
OS: Windows XP Professional
Submission from: (NULL) (129.217.207.95)
Hi,
there seems to be a small bug in formatC:
formatC("foo", format="s", mode="charcacter")
Error in formatC("foo", format = "s", mode = "charcacter") :
'mode' must be "double" ("real") or
2002 Mar 13
1
Commas in formatC
formatC() is great for formatting numbers! But it would be even better if it
could optionally insert commas (or semicolons), e.g.
R> formatC(1234567.89, digits=2, format="f", commas=T)
[1] "1,234,567.89"
Here's a snippet of code that does that, which could more or less just be
inserted into at the end of formatC if any R-core guru were so inclined. "r"
2007 May 25
0
documented/undocumented behavior of as.double(formatC(x, digits=17))
Some days ago, there was a discussion about the command
formatC(exp(1),digits=100,width=-1)
Converting a double value to a string, from which the double may be
reconstructed exactly, may be useful. So, I did some experimentation
with it in my linux installation of R-2.5.0.
I generated a vector x of a large number of random doubles (random sign,
random mantissa with 53 significant bits and
2012 May 26
2
CentOS 6.2: suspending vim with ctrl-z and resuming with fg - stopped working
Hello,
pardon my chaotic question, but does anybody have an idea,
why can't I suspend vim-enhanced-7.2.411-1.6.el6.x86_64
with a CTRL-Z, then execute few commands at my bash prompt
and then get back to the vim session again with "fg"?
It has stopped working at my CentOS 6.2 machine (I haven't
noticed exactly when) but works fine with CentOS 5.x.
I'm using PuTTY to login to
2002 Nov 16
0
Wishlist: allow NA values in medpolish (package 'eda') (PR#2298)
Full_Name: Frederic Schutz
Version: 1.6.1
OS: Linux
Submission from: (NULL) (128.250.252.193)
The subject says everything... This has already been proposed in
June 2001 (cf http://maths.newcastle.edu.au/~rking/R/help/01a/2333.html),
but no reply followed.
I attach the patch that I used on my system to add this feature
(including an updated help page), if it can help. Sorry, the
two
2012 Feb 23
3
I'm sure I'm missing something with formatC() or sprintf()
I have a four-digit string I want to convert to five digits. Take the
following frame:
zip
2108
60321
60321
22030
91910
I need row 1 to read '02108'. This forum directed me to formatC previously
(thanks!) That usually works but, for some reason, it's not in this
instance. Neither of the syntaxes below change '2108' to '02108.' The values
in cand_receipts[,1] are of
2000 Jan 12
0
inconsistencies between formatC(), format() and format.char()
Dear R-Developers,
Just a note: there are some inconsistencies between formatC(), format() and
format.char() and cross calling between these functions.
On the one hand
> cat(format('{"}'), "\n")
{\"}
> cat(format.char('{"}'), "\n")
{\"}
is by default format.char(, flag="-") and thus by default calling format()
>
2005 Nov 22
2
(PR#8337) formatC adds leading space -- on some Windoze
>>>>> "KevinW" == Kevin Wright <kwright68 at gmail.com>
>>>>> on Mon, 21 Nov 2005 18:13:36 +0100 (CET) writes:
KevinW> Full_Name: Kevin Wright
KevinW> Version: 2.2.0
KevinW> OS: Windows 2000
^^^^^^^
this must be part of the problem
KevinW> Submission from: (NULL) (170.54.58.4)
KevinW> Apologies if
2006 Jan 23
1
formatC slow? (or how can I make this function faster?
I'm trying to convert a matrix of capture occasions to format that an
external program can read. The job is to basically take a row of
matrix, like
> smp[1,]
[1] 1 1 0 1 1 1 0 0 0 0
and convert it to the equivalent string "1101110000"
I'm having problems doing this in a speedy way. The simplest solution
(calc_history below, using apply, paste and collapse) takes about 2
2010 Nov 14
1
cannot see the y-labels (getting cut-off)
Hi All,
When I run the following code, I cannot see the entire number. As opposed
to seeing 1,000,000,000. I only see 000,000 because the rest is cut off.
The cex option doesn't seem to be doing anything at all.
y<-seq(1e09,5e09,1e09);
plot(1:5,y,ylab='',yaxt='n' );
axis(2, at=y, labels=formatC(y,big.mark=",",format="fg"),las=2,cex=0.1);
Any thoughts?
2010 Sep 21
1
Colorramp in Maptools, how to choose min and max values for the fg= argument
Hello,
I am using maptools for plooting geographical data.
The colour of the region indicates some region dependent value
(population for example).
I pass the colours of the regions to the plot.Map function by defining
the foreground colour:
jet.colors = colorRampPalette(c("#00007F", "blue", "#007FFF", "cyan",
"#7FFF7F", "yellow",
2018 Oct 25
1
small bug in formatC?
formatC(0.0001, digits = 3, format = "f", zero.print="< 0.01")
Error in strrep(" ", nc - i1) : invalid 'times' value
The problem, if it is one, is in .format.zeros:
.format.zeros("0.000", "xxxxxx")
Error in strrep(" ", nc - i1) : invalid 'times' value
R version 3.5.1.
David
[[alternative HTML version deleted]]