[R] R.oo in R-3.0.1

Henrik Bengtsson hb at biostat.ucsf.edu
Thu Aug 22 21:27:11 CEST 2013


Hi, R.oo author here:

This looks like a possible namespace issues, which might have gone
under the radar if you have only used R v2.11.x until now.  Could you
forward me your MyPackage test package so I can troubleshoot/reproduce
(I think the answer is in your DESCRIPTION/NAMESPACE file).

/Henrik


On Wed, Aug 21, 2013 at 2:47 PM, Grach, Alexander
<alexander.grach at credit-suisse.com> wrote:
> Fellow R users,
>
> I'm trying to upgrade from 2.11 to 3.0.1. I have a legacy S3 class
> defining method "DAILY" within one of our "in-house" packages using
> R.oo. This method does not seem to  get 'resolved' under 3.0.1,
> specifically the following does not work:
>
> ----CODE WITHIN PACKAGE (e.g. MyPackage)-----
> setConstructorS3("MyTestClass", function(name = NULL, ...) {
>     this <- extend(RObject(), "MyTestClass", .units = NULL, .numUnits =
> NULL, .name = name)    #RObject extends Object and adds couple of simple
> methods
>     return(this)
> })
>
> setMethodS3("DAILY", "MyTestClass", function(this, ...) {
>     print("In DAILY.MyTestClass")
> })
>
> setMethodS3("DAILY2", "MyTestClass", function(this, ...) {
>     print("In DAILY2.MyTestClass")
> })
>
> setMethodS3("Daily", "MyTestClass", function(this, ...) {
>     print("In Daily.MyTestClass")
> })
>
> ----CONSOLE---------------------------
>> library(MyPackage)
>> MyTestClass$DAILY()
> Error in MyTestClass$DAILY() : could not find function "DAILY"
>> DAILY.MyTestClass()
> [1] "In DAILY.MyTestClass"
>> MyTestClass$DAILY2()
> [1] "In DAILY2.MyTestClass"
>> MyTestClass$Daily()
> [1] "In Daily.MyTestClass"
> --------------------------------------------
>
> Any ideas as to why MyTestClass$DAILY() fails under 3.0.1 and what is
> the best way to fix this?? I can always change the method name, yet I
> wouldn't know what other methods might have similar issues..  This all
> worked fine in 2.11.
> Also - if I "source" this code it works  fine.
>
> Many thanks,
> Alex
>
>
>
> =============================================================================================================
> This material has been prepared by individual sales and/or trading personnel and does not
> constitute investment research.  Please follow the attached hyperlink to an important disclaimer:
> http://www.credit-suisse.com/americas/legal/salestrading
> =============================================================================================================
>
>
> ===============================================================================
> Please access the attached hyperlink for an important el...{{dropped:4}}
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list