[R-pkg-devel] Registered S3 methods from standard package

Colin Gillespie c@g|||e@p|e @end|ng |rom gm@||@com
Mon May 13 13:26:50 CEST 2019


Dr Colin Gillespie

>
> Or more simply:  call the method prettyBplot.

Rightly (but perhaps wrongly) I was trying for a simple method where
the plots just change. If prettyB loaded, the plots just look a little
nicer. If prettyB isn't available, then the plot function works as normal.

So two possible options are:

  * registerS3method - I suspect this isn't permitted.
  * Don't override plot.default(), but override other methods. E.g.
boxplot.list() and plot.numeric(). But is this going against the
spirit of the law?

Thanks

Colin

>
> Duncan Murdoch
>
> >
> > Resetting to graphics::plot.default should be made possible as well.
> >
> > The question remains whether registerS3method() can be used at all,
> > since the help says:
> >
> >> Internal namespace support functions.  Not intended to be called
> >>       directly, and only visible because of the special nature of the
> >>       ‘base’ namespace.
> >
> > Cheers,
> >
> >       Sebastian
> >
> >
> > Am 13.05.19 um 09:22 schrieb Colin Gillespie:
> >> Dear All,
> >>
> >> I'm developing a small package to make plotting methods a little bit
> >> nicer looking:
> >>
> >> https://github.com/jumpingrivers/prettyB/
> >>
> >> The general idea is to replace plot.default() with an alternative
> >> (matching all arguments) and export. This would allow users to simply
> >> load the package and use base graphics functions as normal, but get a
> >> pretty graph.
> >>
> >> The general pattern I follow is:
> >>
> >> https://github.com/jumpingrivers/prettyB/blob/master/R/plot.R#L23
> >>
> >> which then includes S3method(plot,default) in my NAMESPACE file. When
> >> building and checking the package I get
> >>
> >> Registered S3 methods from standard package(s) overwritten by 'prettyB':
> >>      method          from
> >>      plot.default    graphics
> >>
> >> which CRAN does not permit.
> >>
> >> Question: Is it possible to achieve the functionality I'm after
> >> (replacing the default plot.default() functions) while following the
> >> CRAN rules?
> >>
> >> Thanks
> >>
> >> Colin
> >>
> >> ______________________________________________
> >> R-package-devel using r-project.org mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> >>
> >
> > ______________________________________________
> > R-package-devel using r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-package-devel
> >
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



More information about the R-package-devel mailing list