[R] [FORGED] Main label on Cullen and Frey

Rolf Turner r@turner @ending from @uckl@nd@@c@nz
Sat Sep 1 01:01:51 CEST 2018


On 08/31/2018 11:42 PM, Nick Wray via R-help wrote:

> Hello   Does anyone know how to modify the main label when you plot a
> Cullen & Frey (sounds like an Oxford gentleman's outfitters -
> statistically significant waistcoats a speciality) diagram from the
> "descdist" function?  I've tried setting a variable to the
> descdist(data) but it just returns the summary statistics.

I know nothing about descdist() nor the package fitdistrplus whence it 
comes.  However I *do* know how to look at the code of R functions.
See fortune(250).

The short answer to your question is 'No.'  The main title is hard-wired in.

The long answer is:  It's easy to change:

* edit the function descdist()
* add the argument main="Cullen and Frey graph"
* change the call to plot() (about half way through the code) so
   that it says 'main=main' (rather than 'main="Cullen and Frey graph"')
* call descdist() with the syntax (something like)

     gorp <- descdist(x,discrete=TRUE,main="A Load of Dingoes' Kidneys")

And away you go.

Note: The editing process, however you go at it, will create a version 
of descdist() in your global environment.  This will over-ride (mask)
the package version.  However it will be ephemeral unless you choose to 
save your global environment when you quit from R.

You may wish to extract the code from the source package, edit that code 
in situ, and re-install the package from source.  This way you will get 
your modified version of descdist() every time you load the package.

cheers,

Rolf Turner

-- 
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276



More information about the R-help mailing list