similar to: eapply() fails on baseenv() (PR#8761)

Displaying 20 results from an estimated 8000 matches similar to: "eapply() fails on baseenv() (PR#8761)"

2005 Feb 18
1
eapply weirdness/bug
The following looks like an 'eapply' bug to me: t/subtest> e <- new.env() t/subtest> e$tempo <- quote( 1+'hi') t/subtest> lapply( ls( e), function( x) length( get( x,e))) [[1]] [1] 3 # seems reasonable-- e$tempo is a 'call' object of length 3 t/subtest> eapply( e, length) Error in 1 + "hi" : non-numeric argument to binary operator
2010 Feb 25
2
proto and baseenv()
I understand why the following happens ($.proto delegates to get, which ascends the parent hierarchy up to globalenv()), but I still find it anti-intuitive: > z <- 1 > y <- proto(a=2) > y$z [1] 1 Although this is well-documented behavior; wouldn't it uphold the principle of least surprise to inherit instead from baseenv() or emptyenv()? (See attached patch.) Spurious
2014 Sep 21
1
Bug in new behaviour for all.equal and environments?
Hi R-devel, The following code: all.equal(baseenv(), baseenv()) gives the error when run in a clean R session with latest R-devel (r66650): kevin:~$ R --vanilla --slave -e "all.equal(baseenv(), baseenv())" Error in all.equal.envRefClass(target[[i]], current[[i]], check.attributes = check.attributes, : attempt to apply non-function Calls: all.equal ...
2005 Nov 04
1
Changes to environments in R-devel
I've just committed some changes to R-devel which affect environments. Specifically: - using NULL as an environment is now deprecated: use baseenv() instead. (baseenv() is already available in R 2.2.0, where it returns NULL. For most purposes it retains the same meaning in R-devel.) If you do use NULL, it will be converted to baseenv(), and a warning printed. For example: > f
2011 Aug 27
1
Make a function work on an environemnt
In my R learning I've come across a situation in which a piece of code that works on the work space outside a function does not work inside the function. WARNING THIS EMAIL CONTAINES THE CODE:#rm(list=ls()) THIS WILL CLEAR ALL OBJECTS FROM YOUR WORKSPACE! When I use rm(list=ls()) and then ls() it shows character(0) So I tried to make a quick function to speed this up as follows:
2007 Jan 09
4
A question about R environment
Hi all, I created environment "mytoolbox" by : mytoolbox <- new.env(parent=baseenv()) Is there anyway I put it in the search path ? If you need some background : In a project, I often write some small functions, and load them into my workspace directly, so when I list the objects with ls(), it looks pretty messy. So I am wondering if it is possible to creat an
2006 Apr 04
2
Return function from function with minimal environment
Hi, this relates to the question "How to set a former environment?" asked yesterday. What is the best way to to return a function with a minimal environment from a function? Here is a dummy example: foo <- function(huge) { scale <- mean(huge) function(x) { scale * x } } fcn <- foo(1:10e5) The problem with this approach is that the environment of 'fcn' does not
2007 Mar 01
1
object is not subsettable
Dear colleagues, I've just come across a problem with the following command which is a part of the "metaOverview.R" code file provided as an monography- accompanying file at http://www.bioconductor.org/docs/mogr/metadata: ################################## R> hasChr <- eapply(GOTERM, function(x) + x[grep("chromosome", Term(x))]) Error in
2006 Apr 25
7
R 2.3.0: Use of NULL as an environment is deprecated
Dear R-Devel subscriber, first, let me express my thank to the R-Core team for the new release! I appreciate their efforts and time spent to enhance R. In accordance with the 'NEWS' file (see excerpt of it below), [... o Changed the environment tree to be rooted in an empty environment, available as emptyenv(). baseenv() has been modified to return an environment with emptyenv() as
2006 Apr 25
7
R 2.3.0: Use of NULL as an environment is deprecated
Dear R-Devel subscriber, first, let me express my thank to the R-Core team for the new release! I appreciate their efforts and time spent to enhance R. In accordance with the 'NEWS' file (see excerpt of it below), [... o Changed the environment tree to be rooted in an empty environment, available as emptyenv(). baseenv() has been modified to return an environment with emptyenv() as
2008 Mar 19
7
ls() and classes
Dear R People: I want to get the class of all of the objects in my directory. I was trying: do.call(class,list=ls()) but got an "unused argument error". I'm sure it's simple, but I'm just not seeing it. Any help would be much appreciated. Sincerely, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston -
2006 Mar 25
4
object size vs. file size
Hi, There is rather large discrepancy in the size of the object as it lives in R and the size of the object when it is written to the disk. The object in question is an S4 of a homemade class "sa". I first call a function that writes a list of these objects to a file called "data.RData". The size of this file is 14,411 KB. I would assume on average then, that each list
2018 Dec 21
2
Bug report: R.home() cause package Rcpp failed executing sourceCpp, similar bug are labeled "BUG 16660" since 2016 and here I could provide a solution that tested in my laptop.
https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16660 Here is the bug, which R.home may generate a path contains a whitespace. this will cause Rcpp failed executing sourceCpp > sourceCpp("b:/2018-12-14/src/18020/MCMC.cpp") Error in system(cmd, intern = !showOutput) : 'D:/Program' not found Error in system(cmd, ignore.stderr = TRUE, intern = TRUE) :
2013 Mar 12
2
Bugs due to naive copying of list elements
Several bugs are present in R-2.15.3 and R-alpha due to naive copying of list elements. The bug below is due to naive copying in subset.c (with similar bugs for matrices and arrays): a<-list(c(1,2),c(3,4),c(5,6)) b<-a[2:3] a[[2]][2]<-9 print(b[[1]][2]) Naive copying in mapply.c leads to the following bug: X<-1+1 f<-function(a,b) X A<-mapply(f,c(1,2,3),c(4,5,6),SIMPLIFY=FALSE)
2011 Jan 03
7
Saving objects inside a list
Hello there, any ideas on how to save all the objects on my workspace inside a list object? For example, say my workspace is as follows ls() [1] "x" "y" "z" and suppose I want to put these objects inside a list object, say object.list <- list() without having to explicitly write down their names as in object.list$x = x object.list$y = y object.list$z = z Is
2011 Mar 11
1
dataframe to a timeseries object
I?m wondering which is the most efficient (time, than memory usage) way to obtain a multivariate time series object from a data frame (the easiest data structure to get data from a database trough RODBC). I have a starting point using timeSeries or xts library (these libraries can handle time zones), below you can find code to test. Merging parallelization (cbind) is something I?m thinking at
2006 May 23
2
Environment problems
Dear list readers, Can someone of you explain this behavior. Here's a toy example: Start by constructing a function tmp >fix(tmp) In the default editor enter this one-liner: hist(rnorm(10)) close the editor and run environment on the function. > environment(tmp) <environment: R_GlobalEnv> Open the editor and remove the last parenthesis, this will make the editor choke.
2020 Aug 10
1
lm() takes weights from formula environment
Thank you for your suggestion. I do know how to work around the issue. I usually build a fresh environment as a child of base-environment and then insurt the weights there. I was just trying to provide an example of the issue. emptyenv() can not be used, as it is needed for the eval (errors out even if weights are not used with "could not find function list"). For some applications
2006 Nov 03
1
data.entry(), de() fail in FC6-x86_64
Buffer overflow detect in FC6-x86_64, see down. Juan. R version 2.4.0 (2006-10-03) Copyright (C) 2006 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R ? um software livre e vem sem GARANTIA ALGUMA. Voc? pode redistribu?-lo sob certas circunst?ncias. Digite 'license()' ou 'licence()' para detalhes de distribui??o. R ? um projeto colaborativo com muitos
2016 Aug 05
2
Extra copies of objects in environments when using $ operator?
My understanding is that R will not make copies of lists if there is only one reference to the object. However, I've encountered a case where R does make copies, even though (I think) there should be only one reference to the object. I hope that someone could shed some light on why this is happening. I'll start with a simple example. Below, x is a list with one element, and changing that