[Rd] WG: Formal methods are not loaded from NAMESPACE inreloadedworkspace image
Pfaff, Bernhard Dr.
Bernhard_Pfaff at fra.invesco.com
Fri Nov 3 11:50:26 CET 2006
Sorry, to bother the list one more time: but the following worked at
least for 'urca':
in NAMESPACE I now included explicitly:
import(methods)
a fix of the 'urca'-package will be uploaded to CRAN on the weekend.
Fritz, will this work for ypur package 'flexclust' too? I have in my
DESCRIPTION imports: methods and in flexclust it is in depends: methods.
However, both packages have not import(methods) in their NAMESPACE.
Anyway, I wonder why 'import(methods)' is explicitly needed in
NAMESPACE? Would a smart and bright soul be so kind and enlighten a
flabbergasted one? :-) Many thanks!
Best,
Bernhard
>Dear R-Devel subscriber,
>
>as a follow up to my yesterday's email: I tested an analogous example
>with the S4-package "flexclust" by executing the following code:
>
>library(flexclust)
>example(cclust)
>cl
>
>After saving the work space and starting a new R process with the
>restored work space, the same behaviour (i.e., the methods pertinent to
>"flexclust" are not used, even after executing library(flexclust)).
>Yesterday, I executed the code below on a Linux platform with R 2.4.0
>and it showed the same behaviour as R 2.5.0dev on Windows. As it seems
>right now, the behaviour is platform independent and not peculiar to R
>2.5.0dev.
>
>Any pointers and help for solving this problem is much appreciated.
>
>Best,
>Bernhard
>
>>Dear R-Devel subscriber,
>>
>>I was hinted to the following problem with package 'urca':
>>
>>If one starts R and executes for instance:
>>
>>> library(urca)
>>> example(ur.df)
>>## output as expected, but omitted here
>>> class(lc.df)
>>[1] "ur.df"
>>attr(,"package")
>>[1] "urca"
>>> class(summary(lc.df))
>>[1] "sumurca"
>>attr(,"package")
>>[1] "urca"
>>>
>>
>>everything works fine. Now, save the workspace image and quit R. After
>>starting R again with the previously restored workspace image one has:
>>
>>> ls()
>>[1] "lc.df" "Raotbl3"
>>> class(lc.df)
>>[1] "ur.df"
>>attr(,"package")
>>[1] "urca"
>>
>>lc.df
>>## now the 'show'-method for objects of class 'ur.df' is not utilised,
>>rather the generic
>>## displaying all slots
>>
>>> library(urca)
>>> lc.df
>>
>>## still the same as compared to the above output.
>>## similarily
>>
>>> class(summary(lc.df))
>>[1] "table"
>>
>>
>>In the NAMESPACE file export directives for methods and classes are
>>included as:
>>
>>## Classes
>>exportClasses("urca", "ca.jo", "cajo.test", "ur.kpss", "ca.po",
>>"ur.ers", "ur.pp", "ur.sp", "ur.df", "ur.za", "sumurca")
>>## Methods
>>exportMethods("show", "plot", "summary")
>>
>>Any help or pointers for solving this problem is much appreciated.
>>
>>Best,
>>Bernhard
>>
>>> sessionInfo()
>>R version 2.5.0 Under development (unstable) (2006-10-10 r39600)
>>i386-pc-mingw32
>>
>>locale:
>>LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;LC_
>>MONETARY=
>>German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252
>>
>>attached base packages:
>>[1] "methods" "stats" "graphics" "grDevices"
>"datasets" "utils"
>>
>>[7] "base"
>>
>>other attached packages:
>> urca fortunes
>> "1.0-0" "1.3-2"
>>*****************************************************************
>>Confidentiality Note: The information contained in this
>>mess...{{dropped}}
>>
>>______________________________________________
>>R-devel at r-project.org mailing list
>>https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
>______________________________________________
>R-devel at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-devel
>
More information about the R-devel
mailing list