[R] Scale package change comma defaults?
jrkrideau at inbox.com
Mon Jun 3 14:36:00 CEST 2013
I did just that after getting Duncan's reply. I should have seen it myself but for some reason thought I could treat it as an option. Myopia at its best.
Kingston ON Canada
> -----Original Message-----
> From: bbolker at gmail.com
> Sent: Sun, 2 Jun 2013 20:57:58 +0000
> To: r-help at stat.math.ethz.ch
> Subject: Re: [R] Scale package change comma defaults?
> John Kane <jrkrideau <at> inbox.com> writes:
>> I was using the comma() funtion in the scales page and was
>> wondering how to chage a the defaults. comm(1000) gives me 1,000
>> which is what I usually want but how would I change the output to
> Since the comma() function is just a wrapper for format():
> function (x, ...)
> format(x, ..., big.mark = ",", scientific = FALSE, trim = TRUE)
> Why not just define your own function that does what you want?
> myComma <- function (x, big.mark=",", ...)
> format(x, ..., big.mark = big.mark, scientific = FALSE, trim = TRUE)
>> I had thought that I could simply do
>> comm(1000, big.mark = ".")
>> but I am getting
>> Error in format.default(x, ..., big.mark = ",", scientific = FALSE, trim
> TRUE) :
>> formal argument "big.mark" matched by multiple actual arguments
>> And since I'm here I might as well ask if there is a way
>> to keep a couple fo decemal points rather than rounding to the first
> Not quite sure what you mean here; see ?format for more details.
> might be what you want, but if you're going to use "." for big.mark
> then you might want:
>  "1.200,00"
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
Receive Notifications of Incoming Messages
Easily monitor multiple email accounts & access them with a click.
Visit http://www.inbox.com/notifier and check it out!
More information about the R-help