Re: [R] passing a modified argument to an S3 method

2024-04-21 Thread CRAN.r via R-help
I've got a complicated default value for an argument, basically a "control" argument that's a list with a lot of defaults, and I want to figure out its value before dispatching to a method so I don't need to have the same code repeated at the beginning of every method. None of the default

Re: [R] passing a modified argument to an S3 method

2024-04-20 Thread Berry, Charles via R-help
> On Apr 19, 2024, at 1:36 PM, CRAN.r via R-help wrote: > > Is there a way to pass a modified argument from an S3 generic to a method? > Here's a non-working example that I want to return "abcd". > grep-ing the source code is often a good way to answer a question like this. Particularly,

Re: [R] passing a modified argument to an S3 method

2024-04-20 Thread Jeff Newmiller via R-help
The parameters in a specific call to a function are stored in a special list which is used to move/copy data from the calling environment into the environment created for a particular function call. UseMethod does not act like a normal function call... it does a kind of magic substitution of

Re: [R] passing a modified argument to an S3 method

2024-04-20 Thread Bert Gunter
I do not understand what your goal is here (more context may be helpful, perhaps to others rather than me). So I doubt this is what you want, but here is a guess -- no need to respond if it is unhelpful: ## test.default returns NULL if object "y" not found in **calling environment and