search for: __s3methodstable__

Displaying 17 results from an estimated 17 matches for "__s3methodstable__".

2019 Oct 09
2
S3 lookup rules changed in R 3.6.1
...(I don?t know about 3.6.0). ``` # Define ?package namespace?: ns = new.env(parent = .BaseNamespaceEnv) local(envir = ns, { test = function (x) UseMethod('test') test.default = function (x) message('test.default') test.foo = function (x) message('test.foo') .__S3MethodsTable__. = new.env(parent = .BaseNamespaceEnv) .__S3MethodsTable__.$test.default = test.default .__S3MethodsTable__.$test.foo = test.foo # Or, equivalently: # registerS3method('test', 'default', test.default) # registerS3method('test', 'foo', test.foo) }...
2015 Jul 07
3
List S3 methods and defining packages
Hi, from the man page ?methods, I expected to be able to build pairs (class,package) for a given S3 method, e.g., print, using attr(methods(print), 'info'). However all the methods, except the ones defined in base or S4 methods, get the 'from' value "registered S3method for print", instead of the actual package name (see below for the first rows). Is this normal
2015 Dec 22
0
unloadNamespace() does not address unevaluated promises in the S3 Methods Table
...: #> In get(method, envir = home) : internal error -3 in R_decompress1 #> Error: package or namespace load failed for ?testUnload? Upon investigation this is because the code in registerS3Methods creates a promise using 'delayedAssign' for 'print.object' function in the '.__S3MethodsTable__.' environment within the base environment (which is where the 'print' generic is defined). (see lines 1387-1489 in src/library/base/R/namespace.R). When the second install.packages is called the files are changed before the original promise is evaluated, which causes the error. An easy...
2008 Jul 15
1
methods/namespaces/possible bug
...ot.ts plot.tskernel* Non-visible functions are asterisked Based on this, I think that methods("plot") should return plot.function, so I am almost ready to take the bug word in my mouth. When I debug the methods function it gets to the line S3reg <- ls(get(".__S3MethodsTable__.", envir = defenv), pattern = name) where it searches the .__S3MethodsTable__. object. Consulting the help page it seems that this object is part of the namespace functionality. My guess is that something goes wrong because function is a reserved word? Kasper This has been tested unde...
2015 Jul 08
0
List S3 methods and defining packages
....newcastle.edu.au/R/help/06/07/30791.html > > Kevin Wright > > > On Wed, Jul 8, 2015 at 5:09 AM, Renaud Gaujoux > <renaud at mancala.cbio.uct.ac.za> wrote: >> Thank you for your reply Martin. >> Your code made me realize that S3 methods are added to the >> .__S3MethodsTable__. of the package that defines the generic, not to >> the ones defining the method itself. >> How does things work in the case of a method from one package B >> masking the one from another package A? I don't get any warning >> message and there seems to be only one entry...
2019 Oct 09
0
S3 lookup rules changed in R 3.6.1
...ne ?package namespace?: > ns = new.env(parent = .BaseNamespaceEnv) > local(envir = ns, { > test = function (x) UseMethod('test') > test.default = function (x) message('test.default') > test.foo = function (x) message('test.foo') > > .__S3MethodsTable__. = new.env(parent = .BaseNamespaceEnv) > .__S3MethodsTable__.$test.default = test.default > .__S3MethodsTable__.$test.foo = test.foo > > # Or, equivalently: > # registerS3method('test', 'default', test.default) > # registerS3method('te...
2023 Jul 19
0
proposal for WRE: clarify that use of S4 classes implies use of superclasses
...; ".__C__Matrix" ".__C__sparseMatrix" [4] ".__C__compMatrix" ".__C__whatever" "zzz" [7] ".packageName" ".__C__dsparseMatrix" ".__NAMESPACE__." [10] ".__C__dMatrix" ".__S3MethodsTable__." > sort(names(ns)) [1] ".__C__Matrix" ".__C__compMatrix" ".__C__dMatrix" [4] ".__C__dsparseMatrix" ".__C__generalMatrix" ".__C__sparseMatrix" [7] ".__C__whatever" ".__NAMESPACE__."...
2006 Feb 15
1
S3 generics without NS and cleanEx()
...sctest.mob* and afterwards R> methods(sctest) [1] sctest.Fstats sctest.efp sctest.formula sctest.gefp is missing. Debugging `cleanEx()' shows that those objects are removed from the global environment: ls(envir = env, all.names = TRUE) [1] ".Random.seed" ".__S3MethodsTable__." "GCtorture" [4] "a" "euro" where the second one looks very suspicious. `party_0.4-0.tar.gz' is available from http://www.imbe.med.uni-erlangen.de/~hothorn/party_0.4-0.tar.gz and http://www.imbe.med.uni-erlangen.de/~hothorn/m...
2024 Mar 06
1
Never exporting .__global__ and .__suppressForeign__?
...namespace.R =================================================================== --- src/library/base/R/namespace.R (revision 86054) +++ src/library/base/R/namespace.R (working copy) @@ -806,7 +806,8 @@ if (length(exports)) { stoplist <- c(".__NAMESPACE__.", ".__S3MethodsTable__.", ".packageName", ".First.lib", ".onLoad", - ".onAttach", ".conflicts.OK", ".noGenerics") + ".onAttach", ".conflicts.OK", ".noGener...
2004 Dec 16
1
Problem with postscript graphics device driver
I recently installed R version 2.01 for OS X (version 10.3.6). I now get the following error message when I try to use the postscript function: Error in get(name.opt, envir = envir) : Object ".PSenv" not found This did not happen in previous versions of R (i.e. 1.9). I do not get this error message when using the pdf graphics device driver. Thanks, Jeff Freedman
2012 Mar 09
0
.conflicts.OK no longer working regardless of export(.conflicts.OK) due to "stoplist"
...exports <- nsInfo$exports for (p in nsInfo$exportPatterns) exports <- c(ls(env, pattern = p, all.names = TRUE), exports) ## certain things should never be exported. if (length(exports)) { stoplist <- c(".__NAMESPACE__.", ".__S3MethodsTable__.", ".packageName", ".First.lib", ".onLoad", ".onAttach", ".conflicts.OK", ".noGenerics") exports <- exports[! exports %in% stoplist] } To confirm this is the...
2005 May 06
4
How to understand packages, namespaces, environments
I would be very glad of pointers to information on how the concepts of packages, namespaces and environments are interrelated in R. I am trying to get a handle on this both so I can delve further into understanding other people's code and so I can organize my own in a more coherent manner. From my reading about environments it seems they function as what I would intuitively call
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
2015 Jul 07
0
List S3 methods and defining packages
...the namespace in which the method is defined. I think the former is what you're interested in, but the latter likely what methods() might be modified return. For your use case, maybe something like .S3methodsInNamespace <- function(envir, pattern) { mtable <- get(".__S3MethodsTable__.", envir = asNamespace(envir)) methods <- ls(mtable, pattern = pattern) env <- vapply(methods, function(x) { environmentName(environment(get(x, mtable))) }, character(1)) setNames(names(env), unname(env)) } followed by nmspc = l...
2011 Sep 30
0
R 2.13.2 is released
...libtirpc) provided its header files are in the search path: see the 'R Installation and Administration Manual'. PACKAGE INSTALLATION: o Using a broad exportPattern directive in a NAMESPACE file is no longer allowed to export internal objects such as .onLoad and .__S3MethodsTable__. . These are also excluded from imports, along with .First.lib. BUG FIXES: o fisher.test() had a buglet: If arguments were factors with unused levels, levels were dropped and you would get an error saying that there should be at least two levels, inconsistently with...
2011 Sep 30
0
R 2.13.2 is released
...libtirpc) provided its header files are in the search path: see the 'R Installation and Administration Manual'. PACKAGE INSTALLATION: o Using a broad exportPattern directive in a NAMESPACE file is no longer allowed to export internal objects such as .onLoad and .__S3MethodsTable__. . These are also excluded from imports, along with .First.lib. BUG FIXES: o fisher.test() had a buglet: If arguments were factors with unused levels, levels were dropped and you would get an error saying that there should be at least two levels, inconsistently with...
2008 Nov 28
2
AIC function and Step function
I would like to figure out the equations for calculating "AIC" in both "step() function" and "AIC () function". They are different. Then I just type "step" in the R console, and found the "AIC" used in "step() function" is "extractAIC". I went to the R help, and found: "The criterion used is AIC = - 2*log L + k *