Displaying 8 results from an estimated 8 matches for "r_methodsnamespac".
Did you mean:
r_methodsnamespace
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
2016 Apr 19
4
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
...> Right, R_has_methods_attached() uses that. Probably not the right
> check, since it refers to S4 dispatch, while S4_extends() is used by
> S3 dispatch.
>
> Perhaps S4_extends() should force load the methods package? The above
> example works after fixing the check to ensure that R_MethodsNamespace
> is not R_GlobalEnv, but one could load a serialized S4 object and
> expect S3 dispatch to work with Rscript.
>
> On Tue, Apr 19, 2016 at 6:51 AM, Gabriel Becker <gmbecker at ucdavis.edu>
> wrote:
> > See also .isMethodsDispatchOn, which is what trace uses to decide if...
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
2016 Apr 19
2
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
...t
> >> mostly just leads to confusion, but that won't happen immediately.
> >>
> >> For now, the S4_extends() should probably throw an error when the
> >> methods namespace is not loaded. And the check should be changed to
> >> directly check whether R_MethodsNamespace has been set to something
> >> other than the default (R_GlobalEnv). Agreed?
> >>
> >> On Mon, Apr 18, 2016 at 4:35 PM, Kirill M?ller
> >> <kirill.mueller at ivt.baug.ethz.ch> wrote:
> >>>
> >>> Scenario: An S3 method is declared fo...
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
2016 Apr 19
3
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
...hould probably remove that special case, as it
> mostly just leads to confusion, but that won't happen immediately.
>
> For now, the S4_extends() should probably throw an error when the
> methods namespace is not loaded. And the check should be changed to
> directly check whether R_MethodsNamespace has been set to something
> other than the default (R_GlobalEnv). Agreed?
>
> On Mon, Apr 18, 2016 at 4:35 PM, Kirill M?ller
> <kirill.mueller at ivt.baug.ethz.ch> wrote:
>> Scenario: An S3 method is declared for an S4 base class but called for an
>> instance of a der...
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
2016 Apr 19
0
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
Right, R_has_methods_attached() uses that. Probably not the right
check, since it refers to S4 dispatch, while S4_extends() is used by
S3 dispatch.
Perhaps S4_extends() should force load the methods package? The above
example works after fixing the check to ensure that R_MethodsNamespace
is not R_GlobalEnv, but one could load a serialized S4 object and
expect S3 dispatch to work with Rscript.
On Tue, Apr 19, 2016 at 6:51 AM, Gabriel Becker <gmbecker at ucdavis.edu> wrote:
> See also .isMethodsDispatchOn, which is what trace uses to decide if the
> methods package need...
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
2016 Apr 19
0
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
...thods_attached() uses that. Probably not the right
>> check, since it refers to S4 dispatch, while S4_extends() is used by
>> S3 dispatch.
>>
>> Perhaps S4_extends() should force load the methods package? The above
>> example works after fixing the check to ensure that R_MethodsNamespace
>> is not R_GlobalEnv, but one could load a serialized S4 object and
>> expect S3 dispatch to work with Rscript.
>>
>> On Tue, Apr 19, 2016 at 6:51 AM, Gabriel Becker <gmbecker at ucdavis.edu>
>> wrote:
>> > See also .isMethodsDispatchOn, which is what...
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
2016 Apr 18
3
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
Scenario: An S3 method is declared for an S4 base class but called for
an instance of a derived class.
Steps to reproduce:
> Rscript -e "test <- function(x) UseMethod('test', x); test.Matrix <-
function(x) 'Hi'; MatrixDispatchTest::test(Matrix::Matrix())"
Error in UseMethod("test", x) :
no applicable method for 'test' applied to an
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
2016 Apr 19
0
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
...ing R
with Rscript. We should probably remove that special case, as it
mostly just leads to confusion, but that won't happen immediately.
For now, the S4_extends() should probably throw an error when the
methods namespace is not loaded. And the check should be changed to
directly check whether R_MethodsNamespace has been set to something
other than the default (R_GlobalEnv). Agreed?
On Mon, Apr 18, 2016 at 4:35 PM, Kirill M?ller
<kirill.mueller at ivt.baug.ethz.ch> wrote:
> Scenario: An S3 method is declared for an S4 base class but called for an
> instance of a derived class.
>
> Steps...
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
2016 Apr 19
0
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
...e that special case, as it
>> mostly just leads to confusion, but that won't happen immediately.
>>
>> For now, the S4_extends() should probably throw an error when the
>> methods namespace is not loaded. And the check should be changed to
>> directly check whether R_MethodsNamespace has been set to something
>> other than the default (R_GlobalEnv). Agreed?
>>
>> On Mon, Apr 18, 2016 at 4:35 PM, Kirill M?ller
>> <kirill.mueller at ivt.baug.ethz.ch> wrote:
>>>
>>> Scenario: An S3 method is declared for an S4 base class but called...