Displaying 20 results from an estimated 20000 matches similar to: "R's UseMethod() does not dispatch on changed class() (PR#167)"
2012 Dec 04
1
inconsistencies between ?class and ?UseMethod
Hi,
The 2 man pages give inconsistent description of class():
Found in ?class:
If the object does not have a class attribute, it has an implicit
class, ?"matrix"?, ?"array"? or the result of ?mode(x)? (except
that integer vectors have implicit class ?"integer"?).
Found in ?UseMethod:
Matrices and arrays have class ?"matrix"?
2005 Apr 10
2
the difference between UseMethod and NextMehod?
hi,usRs,i am studing the R programming,but i can not get the point abut the difference between UseMethod and NextMehod.i have read the manual and try to find the solutin from internet,but i still not master it well.so anyone can give me a guide?it will be better to show some examples .
thank you !
2009 Jul 29
1
RFC: methods() and showMethods() {was "debug"}
(a new thread, on purpose)
>>>>> "RobG" == Robert Gentleman <rgentlem at fhcrc.org>
>>>>> on Mon, 27 Jul 2009 16:55:50 -0700 writes:
RobG> Hi, I just committed a change to R-devel so that if
RobG> debug is called on an S3 generic function, all methods
RobG> will also automatically have debug turned on for them
RobG>
1997 Aug 04
3
R-alpha: .Options$digits do not (always) work.
I am sorry that this IS an old topic.
Yet another task
I think the bug is somewhere in hidden in src/main/options.c ..
##-- The following does not work as it should in R (0.50-a1, but I think
also earlier)
tst <- function(x=pi, dig =3) {.Options$digits <- as.integer(dig); print(x);x}
tst()
tst(dig = 12)
##-- This should do the same; it works as expected in R & S :
tst2
2007 Apr 18
1
Gentleman and Ihaka , 2000 paper question
In their paper, "Lexical Scope and Statistical Computing", the authors (
Gentleman and Ihaka ) go to great length explaining why R's use of
lexical scoping creates advantages when doing statistical computations.
If anyone has or is familiar with this paper, could they provide the
main program code for how the "newton" function would be called in their
example on page 500
2001 May 30
2
new book
Just thought I would mention that there is a new O'Reilly book out,
"Developing Bioinformatics Computer Skills", which is ok, pretty
superficial about some things but at least it lets you know what is
happening and where.
R gets a few pages in there, 394-396, mostly nice press and accurate
except that Bill Venables (hi Bill) may be surprised to find out that
he is a member of the
2000 Jul 24
1
scoping problems (PR#614)
I am resubmitting this to r-bugs, since Thomas Lumley indicates that it
might be an error:
On Wed, 5 Jul 2000, Thomas Lumley wrote:
> On Wed, 5 Jul 2000, halvorsen wrote:
>
> > Hola!
> >
> > I have the following simple function:
> >
> > > testcar
> > function(pow){
> > ob <- glm(Pound~CG+Age+Vage,data=car,weights=No,
> >
2010 Apr 27
1
suggestion on method dispatch
Dear all, I have define a function and its methods as follows:
######## beginning of code
fn <- function(x,...){
UseMethod("fn")
}
fn.foo1 <- function(x, commonA=1, ...){
print("fn.foo1 is called.")
}
fn.foo2 <- function(x, uniqueFoo2, common=1, ...){
## uniqueFoo2 is a unique argument in fn.foo2
x <- uniqueFoo2; class(x) <- "foo1"
## use uniqueFoo2
2007 Nov 16
3
Rgraphviz
Rgraphviz
I cannot load it
I have re-installed etc etc etc etc
And cannot load it
Message is
6): Library not loaded: /usr/local/lib/libgvc.3.dylib
Referenced from:
/Library/Frameworks/R.framework/Versions/2.6/Resources/library/Rgraphviz/lib
s/ppc/Rgraphviz.so
Reason: image not found
Error : .onLoad failed in ''loadNamespace'' for ''Rgraphviz''
Error:
2001 Oct 02
1
problem with while loop with next (was RE: file connection, w hile, readLines and browser)
Dear R-help,
I think I have kinda isolated the problem I had to the following:
i <- 0
while( {i <- i + 1} < 5) {
if(i < 3) next
print(i)
}
This seems to go into an infinite loop. After I break the execution, i has
the value 1.
At the R prompt, if I start from i <- 0 and keep typing {i <- i + 1} < 5, it
eventually evaluate to TRUE. So why does the while loop not work?
2001 Jan 10
2
nearest neighbors
Is there an implementation of a reasonable k-nearest neighbor finder
already in one of the packages?
--
+---------------------------------------------------------------------------+
| Robert Gentleman phone : (617) 632-5250 |
| Associate Professor fax: (617) 632-2444 |
| Department of Biostatistics office: not yet
2004 Nov 15
1
UseMethod call with no arguments
Dear R developers,
I will ask a very straightforward question concerning UseMethod's future,
because people depending on my code wonder what will happen to it next.
In R v2.0.1 NEWS it says
o The undocumented use of UseMethod() with no argument is now
formally deprecated.
and in the R v2.0.1 help(UseMethod) it says
'UseMethod' accepts a call with no arguments and tries to
2000 Dec 20
3
glm
It was my fault, as you have seen. Y matrix must contain successes and failures, and not successes and trials.
Sorry for my ignorance and thanks a lot for your help.
Oscar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20001220/341c2519/attachment.html
2001 Nov 16
1
UseMethod() fails to (PR#1176)
match the argument 'x' if there is another argument with prefix 'x'
Full_Name: Henrik Bengtsson
Version: 1.3.1
OS: Sun Solaris 8
Submission from: (NULL) (130.235.3.49)
I ran into a strange problem with UseMethod(). Run the following code:
foo.Bar <- function(this, x=0, xidx=0) {
cat("In foo.Bar(): ", this, ", x=", x, ", xidx=", xidx,
2006 May 19
1
UseMethod infelicity
If I do
> example(lm)
...
> mycoef <- function(object, ...) UseMethod("coef", object)
> mycoef(lm.D9)
Error in mycoef(lm.D9) : no applicable method for "coef"
which is pretty surprising, as coef has a default method.
After a bit of digging, this comes from do_usemethod having
defenv = environment where the generic was defined */
defenv =
2001 Jan 17
4
Can one set --no-save in .Rprofile
(On Unix/Linux)
Is it possible to set the --no-save command line option as an option
in the .Rprofile file. I have looked in the sources and do not see
any obvious (user initiated) ways of changing the command line defaults,
but I am hoping I have missed something.
I *know* I can write my own shell script wrapper that calls R with
whatever arguments I want (and I do that). However there
2001 Oct 02
1
RE: problem with while loop with next
Prof. Tierney,
Thanks very much for the info.
Why does the loop work if I move the assignment out of the condition? E.g.,
the following works:
i <- 0
while(i < 5) {
i <- i + 1
if(i < 3) next
print(i)
}
Regards,
Andy
> -----Original Message-----
> From: Luke Tierney [mailto:luke at nokomis.stat.umn.edu]
> Sent: Tuesday, October 02, 2001 3:36 PM
> To: Liaw, Andy
2003 Feb 28
2
Lexical scoping question
Hello,
Could someone please tell me what I am thinking about incorrectly:
f <- function(y) {
g <- function(x) x + y
g
}
In the following, I get what I expect based on my understanding of
lexical scoping:
(f(1))(3) # 4
(f(2))(3) # 5
But now,
fs <- lapply(c(1, 2), f)
fs[[1]](3) # 5 (Why not 4 ?)
fs[[2]](3) # 5
Checking the environments of these functions, I see that
2023 Oct 20
0
UseMethod forwarding of local variables
UseMethod has since the beginning had the 'feature' that local
variables in the generic are added to the environment in which the
method body is evaluated. This is documented in ?UseMethod and
R-lang.texi, but use of this 'feature' has been explicitly discouraged
in R-lang.texi for many years.
This is an unfortunate design decision for a number of reasons (see
below), so the plan
1999 Jul 15
2
R: UseMethod with primitives?
Hello,
is the following somehow possible with Mod() being a primitive:
"Mod" <- function(x)
UseMethod("Mod")
"Mod.default" <- function(x) {
.Primitive("Mod") ### I know it?s wrong. How can I access the
original Mod ?
}
Thanks for help
M. Eger
--
+-------------------------------------------------------
| Marcus Eger
| Philipps Universitaet