(In hindsight I should have used a `zero.print` value that looked less like a
typo, e.g. `zero.print = "--"` in my example. Sorry about the potential
confusion.)
-Original Message-
From: R-help On Behalf Of Marttila Mikko via
R-help
Sent: Friday, 23 May 2025 13:21
To: Howard, Tim G (DE
Tim,
The purpose of the `replace.zero` argument is to allow longer replacements.
See for example the behaviour with a character vector input:
> prettyNum("0", zero.print = "- ", replace.zero = TRUE)
[1] "- "
I'm pretty sure this is a bug, and have now posted the relevant details on
r-devel.
A
You fed it two characters, "dash" and "space" and it only wanted one character
so it truncated to the first character and warned you that that's what it did.
If you had your space before the dash, it would have used that as your
replacement character
> prettyNum(0, zero.print = " - ", replace =
Dear list,
Have I stumbled upon a bug, or am I holding `prettyNum()` wrong? Please see
below.
Best,
Mikko
> prettyNum(0, zero.print = "- ", replace.zero = TRUE)
[1] "-"
Warning message:
In .format.zeros(x, zero.print, replace = replace.zero) :
'zero.print' is truncated to fit into formatted
4 matches
Mail list logo