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 values
> 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, w
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 th
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 enclosures**
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".
test <- function(x, y = NULL){
y <- "abcd"
UseMethod("test")
}
test.default <- function(x, y = NULL) y
test(x = 3)
Is that possible? I've looked
5 matches
Mail list logo