Displaying 20 results from an estimated 2000 matches similar to: "R-alpha: NextMethod in 0.50-a4"
1998 Feb 24
2
Representation of data in libraries
At present the example data sets in R libraries are to be given as
expressions that can be read directly into R. For example, the acid.R
file in the main library looks like
acid <- data.frame(
carb = c(0.1, 0.3, 0.5, 0.6, 0.7, 0.9),
optden = c(0.086, 0.269, 0.446, 0.538, 0.626, 0.782), row.names = paste(1:6))
This is great when you have only a few observations. I have one
example data
2002 Jun 26
1
Bug? (PR#1710)
Hi,
I tried to do a multiple linear model from the example
dataset Formaldehyde. However, the function lm() did not
estimate the coefficient of the term carb^2. The same
problem occurred with the (nlme)dataset Pixel with both
function lme() and lm(). I am using the windows version of
R 1.5.1
Lauri Mehtatalo
The Formaldehyde example:
> data(Formaldehyde)
>
2005 Apr 02
2
An exercise in the use of 'substitute'
I would like to create a method for the generic function "with" applied
to a class of fitted models. The method should do two things:
1. Substitute the name of the first argument for '.' throughout the
expression
2. Evaluate the modified expression using the data argument to the
fitted model as the first element of the search list.
The second part is relatively easy. The
2000 Dec 30
0
editor in Windows doesn't like a data frame with row names (PR#797)
The editor in R version 1.2.0 returns an error after editing a data frame
that has row names. This is on a Windows 2000 system, but I've encountered
the same problem under Windows 95. Here's a simple example:
------------------------------------------------------------------------------------
R : Copyright 2000, The R Development Core Team
Version 1.2.0 (2000-12-15)
R is free
2000 Dec 31
0
editor in Windows doesn't like a data frame with row names (PR#798)
On Sun, 31 Dec 2000 jfox@mcmaster.ca wrote:
> The editor in R version 1.2.0 returns an error after editing a data frame
> that has row names. This is on a Windows 2000 system, but I've encountered
> the same problem under Windows 95. Here's a simple example:
Actually, that's not where the error is. If you use traceback() you
will see it is in edit.data.frame. That tries
2002 Dec 13
2
how to get Residual Standard Error
Hi,
I use lm or loess to make smoothing. After smoothing I need "Residual
Standard Error" in my script. Could you please tell me how can I get
this information?
Thanks,
2010 Feb 14
1
NextMethod() example from S Programming by Venables and Ripley (page 78)
S Programming by Venables and Ripley (page 78) has the example listed
at the end of this email. However, I get the following error when I
try the example. I don't understand the descriptions of NextMethod on
its help page. Could somebody let me know how to fix the error of this
example?
> test(x)
c1
c2
Error in NextMethod() : no method to invoke
Calls: test -> test.c1 -> NextMethod
2018 Feb 22
0
How to modify dots and dispatch NextMethod
2018-02-22 12:39 GMT+01:00 Tomas Kalibera <tomas.kalibera at gmail.com>:
> On 02/22/2018 12:07 PM, I?aki ?car wrote:
>>
>> 2018-02-22 10:29 GMT+01:00 Tomas Kalibera <tomas.kalibera at gmail.com>:
>>>
>>> The example is invoking NextMethod via an anonymous function, which is
>>> not
>>> allowed (see documentation for NextMethod).
2012 Oct 17
1
Do *not* pass '...' to NextMethod() - it'll do it for you; missing documentation, a bug or just me?
Hi,
although I've done S3 dispatching for more than a decade now, I think
I managed to overlook/avoid the following pitfall when using
NextMethod():
If you explicitly pass argument '...' to NextMethod(), you will
effectively pass those argument twice to the "next" method!
EXAMPLE:
foo0 <- function(...) UseMethod("foo0");
foo1 <- function(...)
2018 Feb 22
2
How to modify dots and dispatch NextMethod
The example is invoking NextMethod via an anonymous function, which is
not allowed (see documentation for NextMethod). Normally one gets a
runtime error "'NextMethod' called from an anonymous function", but not
here as the anonymous function is called via do.call. I will fix so that
there is a runtime error in this case as well, thanks for uncovering
this problem.
I
2010 Apr 23
0
dot dot dot and NextMethod
Hello,
Within the development of a package, I would need to build a specific method
for the "pmin" function.
I first make "pmin" generic
pmin <- function (..., na.rm = FALSE) UseMethod("pmin")
pmin.default <- base::pmin
Now, within my new method, I would like to change the arguments in . (dot
dot dot) before sending it to the NextMethod.
2018 Feb 22
2
How to modify dots and dispatch NextMethod
On 02/22/2018 12:07 PM, I?aki ?car wrote:
> 2018-02-22 10:29 GMT+01:00 Tomas Kalibera <tomas.kalibera at gmail.com>:
>> The example is invoking NextMethod via an anonymous function, which is not
>> allowed (see documentation for NextMethod).
> Thanks for your response. I definitely missed that bit.
>
>> Normally one gets a runtime
>> error
1999 Apr 16
1
NextMethod
>> One clear moral seems to be don't do anything more inside a
>> generic function than you really need to do. Keep it *very*
>> simple indeed.
>>
> I recall JMC saying something like, all generic functions
> should be one line long; a call to the appropriate UseMethod.
It certainly is encouraging to know that others also have been confused by
aspects of
2007 Dec 06
2
simple problems
Hello R users,
I have been looking through Help files and Nabble list for the answers for
these simple questions, but it seems to be fruitless.
1- in a data frame with two columns, x and y, how do I get the corresponding
value of x to, let's say, the minimum value of the y column (min (data$y)) ?
2- how do I solve a simple equation? Considering the equation y= exp(-x)^12,
I would like to find
2019 Aug 07
1
NextMethod() and argument laziness
Hi all, I'd like to ask if the following behavior is a bug. To me it
certainly feels surprising, at the very least. In this example, I would
like to call NextMethod() from my `child` object, have `cols` be left
untouched, and then substitute(cols) in the parent method. It works when
you use a `parent` object (as expected), but I would have also expected to
get `mpg` back when calling it from
2004 Nov 03
4
Newbie question: plotting regression models
Greetings.
Is there any way to get R to take a regression model object and draw a
plot of the regression function? How about overlaying that plot over a
scatterplot of the actual data? Thanks in advance for any help anyone
can provide.
Aaron
-----
Aaron Solomon?? (??ben Saul Joseph??) ??Adelman
E-mail??: ??adelmaas at musc.edu
Web site??: ??http??://??people.musc.edu??/??~adelmaas??/??
2018 Feb 21
0
How to modify dots and dispatch NextMethod
I've set up a repo with a reproducible example of the issue described
in my last email:
https://github.com/Enchufa2/dispatchS3dots
I?aki
2018-02-20 19:33 GMT+01:00 I?aki ?car <i.ucar86 at gmail.com>:
> Hi all,
>
> Not sure if this belongs to R-devel or R-package-devel. Anyways...
>
> Suppose we have objects of class c("foo", "bar"), and there are two
2018 Feb 20
2
How to modify dots and dispatch NextMethod
Hi all,
Not sure if this belongs to R-devel or R-package-devel. Anyways...
Suppose we have objects of class c("foo", "bar"), and there are two S3
methods c.foo, c.bar. In c.foo, I'm trying to modify the dots and
forward the dispatch using NextMethod without any success. This is
what I've tried so far:
c.foo <- function(..., recursive=FALSE) {
dots <-
1998 Jan 03
1
R-beta: NextMethod(.Generic) bug
I'm a day-old R newbie (but a war-weary S veteran), with couple of
first-day questions:
In R 0.61, this code fails.
Ops.test <- function(e1,e2)
{
e1 <- NextMethod(.Generic)
e1
}
x <- 4
class(x) <- "test"
y <- x < 3
The error message is "Error in NextMethod(.Generic) : negative length vectors
are not allowed.".
I assume it is a bug.
2006 Apr 14
3
The object argument of NextMethod.
My question is when the object argument of NexthMethod be used?
In the following example, weather object argument is used will not
affects the result.
###
foo=function(x) {UseMethod("foo")}
foo.cls1=function(x)
{
x=x+1;class(x)<-"ncls"
NextMethod()
}
foo.ncls=function(x)
{
cat("ncls\n")
}
foo.cls2=function(x)
{
cat("cls2\n");print(x)
}