[R-pkg-devel] loadMethod() not available with Rscript

Joshua Ulrich josh.m.ulrich at gmail.com
Wed Sep 20 14:48:10 CEST 2017


Hi Thierry,

On Wed, Sep 20, 2017 at 7:45 AM, Thierry Onkelinx
<thierry.onkelinx at inbo.be> wrote:
> Dear all,
>
> Could someone explain this to me? I have a simple script (see below).
> my_function() is an S4 method. The package imports all functions from
> methods that it uses.
>
> When I run the script in a vanilla R session it works. When using
> Rscript I get the error: Error in loadMethod(function (x, ...)  :
> could not find function "loadMethod"
>
> loadMethod() is NOT used in mypackage and not imported.
>
Rscript does not load/attach the "methods" package like is done in an
interactive R session.

Perhaps your package uses a package that needs methods::loadMethod(),
but does not import it correctly?

> library(mypackage)
> my_function()
>
> Best regards,
>
> ir. Thierry Onkelinx
> Statisticus/ Statiscian
>
> Vlaamse Overheid / Government of Flanders
> INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE
> AND FOREST
> Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
> thierry.onkelinx at inbo.be
> Kliniekstraat 25, B-1070 Brussel
> www.inbo.be
>
> ///////////////////////////////////////////////////////////////////////////////////////////
> To call in the statistician after the experiment is done may be no
> more than asking him to perform a post-mortem examination: he may be
> able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
> The plural of anecdote is not data. ~ Roger Brinner
> The combination of some data and an aching desire for an answer does
> not ensure that a reasonable answer can be extracted from a given body
> of data. ~ John Tukey
> ///////////////////////////////////////////////////////////////////////////////////////////
>
>
> Van 14 tot en met 19 december 2017 verhuizen we uit onze vestiging in
> Brussel naar het Herman Teirlinckgebouw op de site Thurn & Taxis.
> Vanaf dan ben je welkom op het nieuwe adres: Havenlaan 88 bus 73, 1000 Brussel.
>
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



-- 
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com
R/Finance 2017 | www.rinfinance.com



More information about the R-package-devel mailing list