Displaying 20 results from an estimated 1000 matches similar to: "proto and baseenv()"
2006 Apr 11
1
eapply() fails on baseenv() (PR#8761)
eapply() works on most environments, but not on baseenv(). For example,
> x <- 1
> eapply(globalenv(), function(x) x)
$x
[1] 1
> eapply(baseenv(), function(x) x)
list()
I'm probably not going to have time to work on this before 2.3.0, but I
don't think it's really urgent; if no one else fixes it first I'll do it
after the release.
Duncan Murdoch
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
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 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
2020 Aug 10
3
lm() takes weights from formula environment
I wish I had started with "I am disappointed that lm() doesn't continue its search for weights into the calling environment" or "the fact that lm() looks only in the formula environment and data frame for weights doesn't seem consistent with how other values are treated."
But I did not. So I do apologize for both that and for negative tone on my part.
Simplified
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 ...
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
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) :
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
2020 Aug 10
0
lm() takes weights from formula environment
On 10/08/2020 1:42 p.m., John Mount wrote:
> I wish I had started with "I am disappointed that lm() doesn't continue its search for weights into the calling environment" or "the fact that lm() looks only in the formula environment and data frame for weights doesn't seem consistent with how other values are treated."
Normally searching is done automatically by
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
2018 Mar 06
4
Capturing warning within user-defined function
Hi, I am trying to automate the creation of tables for some simply
analyses. There are lots and lots of tables, thus the creation of a
user-defined function to make and output them to excel.
My problem is that some of the analyses have convergence issues, which I
want captured and included in the output so the folks looking at them know
how to view those estimates.
I am successfully able to do
2007 May 15
1
getNamespaceExports("base") error
Hi!
>getNamespaceExports("base")
Error in ls(NULL, all = TRUE) : using 'as.environment(NULL)' is defunct
getNamespaceExports
function (ns)
{
ns <- asNamespace(ns)
if (isBaseNamespace(ns))
ls(NULL, all = TRUE)
else ls(getNamespaceInfo(ns, "exports"), all = TRUE)
}
<environment: namespace:base>
One possible way to fix this could be
2008 Jul 29
1
environment question
Hi R users!
I was looking at some of the example code for the "environment"
function. Here it is:
e1 <- new.env(parent = baseenv()) # this one has enclosure package:base.
e2 <- new.env(parent = e1)
assign("a", 3, envir=e1)
ls(e1)
ls(e2)
exists("a", envir=e2) # this succeeds by inheritance
exists("a", envir=e2, inherits = FALSE)
2013 Feb 22
2
Fitting this data with a gaussian would be great
Hello,I'm still working with this data set, and trying to fit it with a nonlinear model. Here is my data
> small <- c(507680,507670,508832,510184,511272,513380,515828,519160,525046,534046,547982,567124,590208,614506,637876,656846,669054,672976,668800,656070,637136,614342,590970,570752,554480,542882,535630,531276,528682,527682,527020,526834,526802,526860)
test <- glm(dnorm(x),
2018 Mar 06
0
Capturing warning within user-defined function
1. I did not attempt to sort through your voluminous code. But I suspect
you are trying to reinvent wheels.
2. I don't understand this:
"I've failed to find a solution after much searching of various R related
forums."
A web search on "error handling in R" **immediately** brought up ?tryCatch,
which I think is what you want.
If not, you should probably explain why it
2020 Jun 30
4
R-devel internal errors during check produce?
>>>>> Kurt Hornik
>>>>> on Tue, 30 Jun 2020 06:20:57 +0200 writes:
>>>>> Jan Gorecki writes:
>> Thank you both, You are absolutely correct that example
>> should be minimal, so here it is.
>> l = list(a=new.env(), b=new.env()) unique(l)
>> Just for completeness, env_list during check that raises
2018 Mar 06
0
Capturing warning within user-defined function
You can capture warnings by using withCallingHandlers. Here is an example,
its help file has more information.
dataList <- list(
A = data.frame(y=c(TRUE,TRUE,TRUE,FALSE,FALSE), x=1:5),
B = data.frame(y=c(TRUE,TRUE,FALSE,TRUE,FALSE), x=1:5),
C = data.frame(y=c(FALSE,FALSE,TRUE,TRUE,TRUE), x=1:5))
withWarnings <- function(expr) {
.warnings <- NULL # warning handler will
2018 Mar 06
1
Capturing warning within user-defined function
tryCatch() is good for catching errors but not so good for warnings, as
it does not let you resume evaluating the expression that emitted
the warning. withCallingHandlers(), with its companion invokeRestart(),
lets you collect the warnings while letting the evaluation run to
completion.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Tue, Mar 6, 2018 at 2:45 PM, Bert Gunter <bgunter.4567 at