Displaying 20 results from an estimated 36 matches for "topenv".
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 leve...
2019 Mar 28
0
topenv of emptyenv
>>>>> Konrad Rudolph
>>>>> on Sat, 23 Mar 2019 14:26:40 +0000 writes:
>>>>> Konrad Rudolph
>>>>> on Sat, 23 Mar 2019 14:26:40 +0000 writes:
> 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...
2009 Jul 09
1
class export in package creation / setClass / namespace?
...ear all,
I have been trying to create an R package. This has been successfull until I
tried to define classes.
Currently, my procedure is the following:
Start R, load the function and class definition
>tmp <- function (x) {x}
>setClass("rpa", contains = "list", where=topenv(parent.frame()))
Use package skeleton to create directory structure:
>package.skeleton(name = "test",list=c("tmp"))
Edit man files, add test/NAMESPACE file with the following contents:
>export(tmp)
>exportClasses("rpa")
Use R CMD check and R CMD build to cr...
2019 May 22
1
print.<strorageMode>() not called when autoprinting
...s should be independent of user customisations. For instance a
package author might gather tabular data in a matrix or data frame and
print() it as part of a larger print method. In that case, user
customisations might cause a mess.
Would it make sense to resort to autoprint customisation when the
topenv() of the parent.frame() of print() is the global environment,
and ignore the customisation otherwise? This should ensure consistent
printing behaviour at the REPL and in scripts. Checking the topenv()
allows print() calls inserted to debug lapply'd functions to behave the
same as when called fr...
2011 Jun 24
4
How to capture console output in a numeric format
Hi,
I would like to know how to capture the console output from running an algorithm for further analysis. I can capture this using capture.output() but that yields a character vector. I would like to extract the actual numeric values. Here is an example of what I am trying to do.
fr <- function(x) { ## Rosenbrock Banana function
on.exit(print(f))
x1 <- x[1]
x2 <- x[2]
2007 Jun 04
2
locked environment and inheritance
...te
a S4 class which extends (adds 2 slots) another S4 class from some other package. The class
should be created in "myPkg" environment (and not global environment).
Using:
setClass("myS4class", representation("otherS4class", mydata = "numeric"),
where = topenv())
I get:
Error in assign(classMetaName(Class), def, where) :
cannot add bindings to a locked environment
I understand the fact that after "myPkg" is loaded, its namespace is sealed, but I was hoping to find a way around it.
I would appreciate any comment on this.
thank...
2004 Jun 18
0
Problem with setValidity() or resetClass() or ... ?
...)
setClass("Class3", representation("Class2"))
setClass("Class4", representation("Class3"))
setClass("Class5", representation("Class4"))
getClass("Class3") # as I expected
Class3Def <- getClassDef("Class3", where = topenv(parent.frame()))
## the following is called in setValidity() via resetClass()
## (further explanations, see below)
completeClassDefinition("Class3", Class3Def,
where = topenv(parent.frame()), doExtends = TRUE)
## 'Extends' includs only "Class2"
##
## would give...
2015 Jan 21
2
reducing redundant work in methods package
Doing it like this:
genericForPrimitive <- function(f, where = topenv(parent.frame()), mustFind
= TRUE) {
ans = .BasicFunsList[[f]]
## this element may not exist (yet, during loading), dom't test null
if(mustFind && identical(ans, FALSE))
stop(gettextf("methods may not be defined for primitive function %s
in this version of R&...
2008 May 13
3
R benchmarking program
...tephan Steinhaus (stst at informatik.uni-frankfurt.de)
# Reference for Escoufier's equivalents vectors (test III.5):
# Escoufier Y., 1970. Echantillonnage dans une population de variables
# aleatoires r??les. Publ. Inst. Statis. Univ. Paris 19 Fasc 4, 1-47.
...
Error in getClass(Class, where = topenv(parent.frame())) :
"geMatrix" is not a defined class
Calls: new -> getClass
Execution halted
2004 Jan 09
1
pb with install
...s sealed; new superclasses can not be defined,
except by setClassUnion
Error in setIs("character", "characterORMIAME", where = where) :
Class "character" is sealed; new superclasses can not be defined,
except by setClassUnion
Error in getClass(Class, where = topenv(parent.frame())) :
"MIAME" is not a defined class
Error in library(affy) : .First.lib failed
Is someone still have this problem ?
Ghislaine GUIGON
Biostatisticienne
2003 Sep 02
1
completeSubclasses() methods bug (PR#4051)
...BioC CVS) fails to load. annaffy 1.0 (on the BioC web site)
has the same problem.
It looks like the load is failing because of a bug in completeSubclasses() in
r-devel. It calls setIs() and doesn't specify an environment via the "where"
argument. setIs() "where" defaults to topEnv() and fails because "aafGO" doesn't
exist in that environment and "list" is sealed.
completeSubclasses should be specifying my package for "where" instead of using
the default.
> library(annaffy)
Error in setIs(class2, obji@superClass, extensionObject = obji,...
2019 Oct 09
2
S3 lookup rules changed in R 3.6.1
...be available in the
> environment of the call to the generic, or they must be registered. (It
does
> not matter whether they are visible in the environment in which the
generic is
> defined.) As from R 3.5.0, the registration data base is searched after
the
> top level environment (see ?topenv?) of the calling environment (but
before
> the parents of the top level environment).
This used to work but it stopped working in R 3.6.1 and I cannot figure out
(a)
why, and (b) how to fix it. Unfortunately I am unable to find the relevant
information by reading the R source code, even when ?d...
2007 Jan 28
2
reposTools
Dear List,
I tested the example in the reposTools vignette:
library(reposTools);
Loading required package: tools
genRepos("Test
Repository", "http://biowww.dfci.harvard.edu/~jgentry/","newRepos");
Error in rep.int(colnames(x), nr) : unimplemented type 'NULL' in 'rep'
Could someone help me out with this one?
I'd appreciate all help....
I am
2004 Oct 05
1
How to install affy package in R?
...ts,
[1] "ProgressBarText"
[1] "initialize"
[1] "open"
[1] "open"
[1] "update"
[1] "update"
[1] "close"
[1] "close"
Error in getClass(Class, where = topenv(parent.frame())) :
"MIAME" is not a defined class
Execution halted
/bioinfo/apps/lib/R/bin/INSTALL: line 1: 761 Broken pipe cat
"/home/sxv6413/rstuffs/lib/affy/R/affy"
ERROR: execution of package source for 'affy' failed...
2015 Jan 22
0
reducing redundant work in methods package
...l(ans, FALSE) should
be is.null(ans).
So no error is thrown:
> methods:::genericForPrimitive("foo")
NULL
Will fix.
On Wed, Jan 21, 2015 at 3:13 PM, Peter Haverty <haverty.peter at gene.com> wrote:
> Doing it like this:
>
> genericForPrimitive <- function(f, where = topenv(parent.frame()), mustFind
> = TRUE) {
>
> ans = .BasicFunsList[[f]]
>
> ## this element may not exist (yet, during loading), dom't test null
>
> if(mustFind && identical(ans, FALSE))
>
> stop(gettextf("methods may not be defined for pr...
2019 Oct 09
0
S3 lookup rules changed in R 3.6.1
...one:
------------------------------------------------------------------------
r75127 | hornik | 2018-08-13 09:58:47 -0400 (Mon, 13 Aug 2018) | 2 lines
Changed paths:
M /trunk/src/main/objects.c
M /trunk/tests/reg-tests-1a.R
Have S3 methods lookup by default look for the S3 registry in the topenv
of the generic.
------------------------------------------------------------------------
Duncan Murdoch
>
> I am implementing S3 dispatch for generic methods in environments that are
> not
> packages. I am trying to emulate the R package namespace mechanism by
> having a
> ?nam...
2003 Sep 27
2
does isGeneric work differently in 1.8.0 ?
Hello,
the last command (isGeneric) in following R-code (attached) produces
different output, depending on wheter 1.8.0 alpha or 1.7.1 is used.
Is that to be expected ?
Both R Versions were started with option vanilla
---------------------------------------------------
R.1.7.1:
---------------------------------------------------
> version
_
platform i686-pc-linux-gnu
arch i686
2009 Nov 12
1
S4 objects in the data directory
...CMD check ./anRpackage
* checking for working pdflatex ... OK
[snip]
* checking data for non-ASCII characters ... NOTE
Error: "foo" is not a defined class
Call sequence:
8: stop(gettextf("\"%s\" is not a defined class", Class), domain = NA)
7: getClass(Class, where = topenv(parent.frame()))
6: new("foo", x = rep(2, 7))
5: eval(expr, envir, enclos)
4: eval(i, envir)
3: sys.source(zfile, chdir = TRUE, envir = envir)
2: switch(ext, R = , r = {
library("utils")
sys.source(zfile, chdir = TRUE, envir = envir)
}, RData = , rdata = , rda = load(zfile, envi...
2007 May 27
2
[Bioc-devel] promptClass
...x: RMethodUtils.R
===================================================================
--- RMethodUtils.R (revision 41719)
+++ RMethodUtils.R (working copy)
@@ -621,7 +621,7 @@
getMethodsMetaData <-
## get the methods meta-data for function f on database where
function(f, where = topenv(parent.frame())) {
- mname <- mlistMetaName(f, where)
+ mname <- mlistMetaName(f, getPackageName(where))
if(exists(mname, where = where, inherits = missing(where)))
get(mname, where)
else
Seth Falcon <sfalcon at fhcrc.org> writes:
> cstr...
2015 Jan 21
2
reducing redundant work in methods package
Hi all,
The function call series genericForPrimitive -> .findBasicFuns -> .findAll
happens 4400 times while the GenomicRanges package is loading. Each time
.findAll follows a chain of environments to determine that the methods
namespace is the only one that holds a variable called .BasicFunsList. This
accounts for ~10% of package loading time. I'm sure there is some history
to that