search for: gets3method

Displaying 20 results from an estimated 89 matches for "gets3method".

2005 Jan 17
5
find source code
...ot;add.scope" .............. [181] "kruskal.test" "ks.test" "ksmooth" ....................... [475] "window<-" "write.ftable" "xtabs" > class(kruskal.test) [1] "function" > getS3method("kruskal.test","function") Error in getS3method("kruskal.test", "function") : S3 method kruskal.test.function not found > getS3method("stats::kruskal.test","function") Error in getS3method("stats::kruskal.test", &quot...
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 environment(get("coef<-.corSPT")) <- environment(getS3method("coef<...
2004 Aug 03
2
lme fitted correlation of random effects: where is it?
The print method for lme *prints out* the fitted correlation matrix for the random effects. Is there any way to get these values as an object in R? I have examined the components of the lme object (called "junk" in the example below) and the components of summary(junk) without finding these numbers. (How I did this: I dumped the entire lme object to a text file and then used egrep to
2019 Oct 09
2
S3 lookup rules changed in R 3.6.1
...ied to an object of class "c('double', 'numeric')" ``` It?s worth noting that the output of `.S3methods` is the same for all R versions, and from my understanding of its output, this *should* indicate that S3 lookup should behave identically, too. Furthermore, lookup via `getS3method` succeeds in all R versions, and (again, in my understanding) the logic of this function should be identical to the logic of R?s internal S3 dispatch: ``` getS3method('test', 'default')(1) getS3method('test', 'foo')(1) ``` Conversely, specialising an existing gener...
2005 Feb 11
3
getAnywhere and functions starting with "." (PR#7684)
...: 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) && !is.null(f <- getS3method(gen, cl, TRUE))) { Mark
2011 Aug 26
1
methods() not listing some S3 plot methods...?
...plot.table* [43] plot.trellis* plot.ts plot.tskernel* [46] plot.TukeyHSD plot.Variogram* Non-visible functions are asterisked > pmeth <- methods("plot") > grep("plot.mgcv.smooth", pmeth) integer(0) > getS3method("plot", "mgcv.smooth") Error in getS3method("plot", "mgcv.smooth") : S3 method 'plot.mgcv.smooth' not found > pfun <- getAnywhere("plot.mgcv.smooth") > str(pfun) List of 5 $ name : chr "plot.mgcv.smooth" $ objs :L...
2007 Jul 17
1
data.restore() in R 2.5.1 for Windows 95 and later
...ave 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() is mentioned in the R Data Import/Export manual. I have also tried apropos() and "character(0)" returns. Additionally, I tried > getS3method("data","restore") but get Error in getS3method("data", "restore") : no function 'data' could be found In addition, I tried > dget("filepath/filename") and it was taking a very long time to import the desired data dump objects which p...
2019 Oct 09
0
S3 lookup rules changed in R 3.6.1
...#39;double', 'numeric')" > ``` > > It?s worth noting that the output of `.S3methods` is the same for all R > versions, and from my understanding of its output, this *should* indicate > that > S3 lookup should behave identically, too. Furthermore, lookup via > `getS3method` > succeeds in all R versions, and (again, in my understanding) the logic of > this > function should be identical to the logic of R?s internal S3 dispatch: > > ``` > getS3method('test', 'default')(1) > getS3method('test', 'foo')(1) > ``` &gt...
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
2004 Nov 29
4
"non-visible" functions in return to methods()
Please point me to the documentation explaining why some of the functions returned by calling methods() are marked as "non-visible" and whether there is indeed no way of viewing the R code of such functions thanks Steve _________________________________________________________________
2004 Aug 25
0
Q: how to submit documentation patches?
.../methods.Rd 2003-12-09 02:24:25.000000000 -0500 +++ R-1.9.1/src/library/utils/man/methods.Rd 2004-08-24 23:33:44.000000000 -0400 @@ -47,7 +47,8 @@ The original \code{methods} function was written by Martin Maechler. } \seealso{ - \code{\link{S3Methods}}, \code{\link[base]{class}}, \code{\link{getS3method}} + \code{\link{S3Methods}}, \code{\link[base]{class}}, \code{\link{getS3method}}, + \code{\link[methods]{showMethods}} } \references{ Chambers, J. M. (1992)
2006 Mar 08
1
Accessing functions in a library
I am trying to write a modified function to plot an rpart object. By using getS3method I can see the plot and text code that I want to modify. Since I don't want to modify the package, I create a new function to plot the rpart object. The problem is that the original function calls many rpart specific functions that are only visible inside the rpart namespace. Therefore, when...
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
2003 Aug 05
1
(PR#3658)
...riable "nomethod" was not found However, 'getAnywhere' behaves gracefully if the non-existent name lacks a period: > getAnywhere( 'nomethod') no object named `nomethod' was found the latter being an object of class 'getAnywhere'. The cause is actually in getS3method which isn't respecting the 'optional=TRUE' argument when it can't find any function to match its first argument. Whether this is strictly a bug in getS3method, I'm not sure-- but the side-effect in getAnywhere seems undesirable. Mark --please do not edit the information bel...
2005 Apr 11
0
exists("loadings.default") ...
...ut I can't guard against the PaulG> possibility that those might actually be defined in stats someday. Yes, you are correct, one cannot easily use exists() for this when namespaces are involved. For S3 methods, instead of exists(), I think one should use something like > !is.null(getS3method("loadings", "default", optional = TRUE)) [1] FALSE > !is.null(getS3method("predict", "ppr", optional = TRUE)) [1] TRUE Apart from the need to mention something along this line on 'exists' help page, I wonder if we shouldn't even conside...
2013 Aug 23
1
Accessing the formals() of a non-exported method without :::?
Dear List, I'm in the process of making tweaks to my various R packages following changes in r-devel for package checks. I'm wondering about the one use of ::: in one of my packages. I am arranging for a call to a non-exported S3 method via do.call. For this I need the arguments of the function and hence I was doing Args <- head(formals(analogue:::wa.default), -1) Following the
2005 Sep 22
2
accessing source code in R packages
Hi, I am new the R world and would like to know how can I access source codes of standard functions in R? Thanks, Ritesh.
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
2007 Nov 05
5
xtable.by
...(assuming not, otherwise it'd be in the documentation)? If the answers to both of the above are "no," then can someone give me a pointer to a basic but thorough explanation of how generic functions and methods are structured (S3, I believe), preferably online. I tried doing this via getS3method("xtable","data.frame") and working from there, but the method merely sets up things for the generic function to render (it's likely I'm getting my terminology somewhat wrong here; please forgive) and what I want to do is beyond the bounds of modifying it in this way. I&...
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