similar to: S3 lookup rules changed in R 3.6.1

Displaying 20 results from an estimated 3000 matches similar to: "S3 lookup rules changed in R 3.6.1"

2019 Oct 09
0
S3 lookup rules changed in R 3.6.1
On 09/10/2019 3:22 p.m., Konrad Rudolph wrote: > tl;dr: S3 lookup no longer works in custom non-namespace environments as of > R 3.6.1. Is this a bug? I don't know whether this was intentional or not, but a binary search through the svn commits finds that the errors started in this one: ------------------------------------------------------------------------ r75127 | hornik |
2005 Jan 17
5
find source code
I am using R 2.0.2 on a WinXP I am trying to get the code of the Kruskal-Wallis test but > kruskal.test function (x, ...) UseMethod("kruskal.test") <environment: namespace:stats> > ls(3) [1] "acf" "acf2AR" "add.scope" .............. [181] "kruskal.test" "ks.test"
2009 Sep 09
1
Monkey patching +.POSIXt
Hi all, This summer I've been working with a grad student to bring more of the date time classes from JODA (http://joda-time.sourceforge.net/) into R. To make these work seamlessly with existing date time objects, we need to patch +.POSIXt. (The ruby community uses the term monkey-patching for this sort of ill-advised, by sometimes necessary, internal hackery, hence the title.) The problem is
2019 May 19
2
[R-pkg-devel] Three-argument S3method declaration does not seem to affect dispatching from inside the package.
On Sat, 18 May 2019 at 23:34, Pavel Krivitsky <pavel at uow.edu.au> wrote: > > > The issue here is that you are registering a non-standard name > > (.gen.formula) for that generic and then defining what would be the > > standard name (gen.formula) for... what purpose? IMHO, this is a bad > > practice and should be avoided. > > The situation initially arose
2010 May 19
2
How to look up source code for cor.test()
Dear all, how can I check the source code for a hidden function like cor.test()? At the moment I get ... > cor.test function (x, ...) UseMethod("cor.test") <environment: namespace:stats> Thanks in advance, Will
2011 Aug 26
1
methods() not listing some S3 plot methods...?
Dear List, This may be related to this email thread initiated by Ben Bolker last month: https://stat.ethz.ch/pipermail/r-devel/2011-July/061630.html In answering this Question on StackOverflow http://stackoverflow.com/q/7195628/429846 I noticed that `methods()` was not listing some S3 methods for `plot()` provided by the mgcv package. At the time I wanted to check the development version of R as
2008 Jul 18
2
source code functions
>na.contiguous function (object, ...) UseMethod("na.contiguous") <environment: namespace:stats> this is what I get when I look for the source code for some functions- Is there a way to look at the source code? -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like
2005 Jan 03
4
Inspecting R functions
In S-Plus, I can look at the structure of a function (for example, hist) simply by entering hist <RETURN> however, if I do this in R, I get the response function (x, ...) UseMethod("hist") <environment: namespace:graphics> How can I inspect the structure of a function in R? ------------------------------- Richard Dybowski 143 Village Way
2010 Apr 27
2
when setting environment: target of assignment expands to non-language object
Hi, I am trying to place my own functions in the nlme environment: The following statement works: environment(coef.corSPT) <- environment(getS3method("coef","corSpatial")) but this one returns an error: environment(get("coef<-.corSPT")) <- environment(getS3method("coef<-","corSpatial")) Error in
2020 May 12
4
S3 method dispatch for methods in local environments
Dear All, In R 3.6.3 (and earlier), method dispatch used to work for methods stored in local environments that are attached to the search path. For example: myfun <- function(y) { out <- list(y=y) class(out) <- "myclass" return(out) } print.myclass <- function(x, ...) print(formatC(x$y, format="f", digits=5)) myfun(1:4) # prints: [1]
2006 Feb 15
1
S3 generics without NS and cleanEx()
Good morning, we recently observed a problem with importing S3 generics from a foreign package (without namespace), defining a S3 method in a package _with_ namespace and the `cleanEx()' function which is automatically generated and executed before examples are run by R CMD check. To be more precise. Package `strucchange' defines a S3 generic sctest <- function(x, ...)
2004 Sep 27
2
Getting code for functions
Hello Pardon for the elementary question, I did try searching the archives with various terms, but to no avail. I am using R1.9.1 on a windows machine One of the great advantages of R (to me, anyway) is being able to see the code for a function , e.g. by typing sd one sees the code for getting a standard deviation. However, for many functions this only provides info. including UseMethod, eg.
2005 Feb 11
3
getAnywhere and functions starting with "." (PR#7684)
Full_Name: Mark Bravington Version: 2.0.1 OS: Windows XP Submission from: (NULL) (140.79.22.104) 'getAnywhere' crashes when its argument starts with a period: > getAnywhere( '.onLoad') Error in exists(x, envir, mode, inherits) : invalid first argument One fix might be to replace the line if ( !is.null(f <- getS3method(gen, cl, TRUE))) { with if ( nchar( gen)
2005 Jan 26
2
Source code for "extractAIC"?
Dear R users: I am looking for the source code for the R function extractAIC. Type the function name doesn't help: > extractAIC function (fit, scale, k = 2, ...) UseMethod("extractAIC") <environment: namespace:stats> And when I search it in the R source code, the best I can find is in (R source root)/library/stats/R/add.R: extractAIC <- function(fit, scale, k = 2,
2007 Jul 17
1
data.restore() in R 2.5.1 for Windows 95 and later
To Whom It May Concern: I want to read in an S-PLUS data dump and I used > data.restore("filepath/filename") (in R 2.5.1 for Windows 95 and later) and I get the message Error: could not find function "data.restore" I have also tried read.S() and read.dta() with the same result. I cannot find any of these functions in the R Help for package base, although data.restore()
2004 Dec 16
2
reading svm function in e1071
Hi, If I try to read the codes of functions in e1071 package, it gives me following error message. >library(e1071) > svm function (x, ...) UseMethod("svm") <environment: namespace:e1071> > predict.svm Error: Object "predict.svm" not found > Can someone help me on this how to read the codes of the functions in the e1071 package? Thanks. Raj
2009 Apr 04
1
Extracting a function from a R package
Dear List, I typed > page(survival:::print.coxph, "print" ) and I got the respective codes. > page(MASS::lda, "print") gives me ############################### function (x, ...) UseMethod("lda") <environment: namespace:MASS> ############################### Is there any way I can get/extract the lda function from MASS? Thanks for your attention. >
2008 Dec 05
1
How to retrieve a method
Hi there, I am interested in the inner workings of wilcox.test: > wilcox.test function (x, ...) UseMethod("wilcox.test") <environment: namespace:stats> how can I get at the code, if it is R-code? For Methods one should be able to learn what extension to use, but here default or such do not help. Is there a wayplot.default to learn which different versions of
2004 Jul 02
2
hclust
im using plclust and want the labels to be different colors. i took a look at getS3method("plot","hclust") and saw a call to .Internal. i looked at the help on .Internal and dont know where to go next. any help appreciated! thanks, rafael
2019 Mar 23
4
topenv of emptyenv
I was surprised just now to find out that `topenv(emptyenv())` equals ? `.GlobalEnv`, not `emptyenv()`. From my understanding of the description of `topenv`, it should walk up the chain of enclosing environments (as if by calling `e = parent.env(e)` repeatedly; in fact, that is almost exactly its implementation in envir.c) until it hits a top level. However, `emptyenv()` has no enclosing