Skip to content
Prev 59493 / 398502 Next

How to change the significant codes default?

On 20-Nov-04 Uwe Ligges wrote:
It would be possible to re-define 'printCoefmat' privately
so as to change the lines

      cutpoints = c(0, 0.001, 0.01, 0.05, 0.1, 1),
      symbols = c("***", "**", "*", ".", " "))

towards the end of its code into whatever you prefer, e.g.

      cutpoints = c(0, 0.01, 0.05, 0.1, 1),
      symbols = c("***", "**", "*", " "))

or

      cutpoints = c(0, 0.001, 0.01, 0.05, 0.1, 1),
      symbols = c("****", "***", "**", "*", " "))

(both of which are compatible with your description of what
is needed).

The most straightforward way of redefining it is to copy
the code for 'printCoefmat' into a file, e.g.

  sink("printCoefmat.R")
  printCoefmat
  sink()

and then edit that file.
NOTE that the code written to the file does not include
the name of the function, i.e. it starts

  function (x, digits = max(3, getOption("digits") - 2),....

so the first modification has to be

  printCoefmat<-function(x, digits = .... )

Then, when you want your private version, simply do

  source("printCoefmat.R")

and it will overlay the original version. (Experts will have
to advise whether this clashes with any "namespace" issues.
On my reading of the code, it doesn't seem to; but I'm no
expert!)

If your friend wants to use this new definition all the time,
then one way to arrange this is to put the revised function
definition (as in the edited file) into his .Rprofile,
or put the command
  source("printCoefmat")
into that file.

Best wishes,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 094 0861  [NB: New number!]
Date: 20-Nov-04                                       Time: 19:13:23
------------------------------ XFMail ------------------------------