Displaying 20 results from an estimated 30000 matches similar to: "strange warning message"
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 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
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
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
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
2006 Jun 15
3
annoying warnings in ESS/Emacs
Hi,
I'm not sure if this is an R problem, a Debian problem, a GNU Emacs
problem or an ESS problem. I get the following warning the first time I
call help on a command in a session, for example:
> ?sessionInfo
Warning message:
use of NULL environment is deprecated
This only occurs in GNU Emacs, not when running R from bash, and not
with Xemacs. It started happening when I updated R
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
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
2005 Nov 16
5
"Warning message: package '...' was built under R version 2.3.0"
Hi,
While installing precompiled packages I often get warnings like the one in
the subject. I usually ignore them, but I still do not understand why
windows packages are build with unreleased versions of R.
Is there some way to get packages build under R-2.2.0?
What are potential problems that can result from that version mismatch?
My system: winXP
R version: 2.2.0
Jarek Tuszynski
2012 Mar 21
1
enableJIT() and internal R completions (was: [ESS-bugs] ess-mode 12.03; ess hangs emacs)
Hello,
JIT compiler interferes with internal R completions:
compiler::enableJIT(2)
utils:::functionArgs("density", '')
gives:
utils:::functionArgs("density", '')
Note: no visible global function definition for 'bw.nrd0'
Note: no visible global function definition for 'bw.nrd'
Note: no visible global function definition for 'bw.ucv'
2006 Sep 27
2
How to pass expression as an argument
Hi,
I am writing a function and need to pass a function expression as an argument, for instance,
myfun <- function( express) {
x<- c(1,2,3)
y<-express
}
if I call the above function by myfun( x*2 ), I get 2 as the result, instead of 2,4,6 , could someone help me to
fix this problem ?
Furthermore, is that
2011 Jan 06
2
Global variables
Dear R-users,
Is there a way I can prevent global variables to be visible within my
functions?
Sebastien
2007 Feb 02
2
A question about dput
Hi,
I am trying to output a R data set for use in WinBugs, I used
dput(list(x=rnorm(100),N=100),file="bug.dat")
But I can't get the intended format: list(x=c(.......),N=100), instead, I got
something like this (copied the first two lines):
[00000000]???73?74?72?75??63?74?75?72??65?28?6C?69??73?74?28?78???? structure(list(x
2005 Jun 28
2
How to import data as numeric array?
Did some search but couldn't find useful result.
I am trying to read a n*m dimension data with read.table, what i need is a numeric array,
is there any efficient way to allow me get this array directly instead of a list?
I tried to use as.array() to change the mode, but seems it doesn't work and i got this error message:
"Error in "dimnames<-.data.frame"(`*tmp*`,
2007 Sep 04
1
Variable scope in a function
Hello,
I apologise in advance for this question; I'm sure it is answered in
the documentation or this mailing list many times, however the answer
has eluded me.
I'm trying to write a function where I don't want external variables
to be scoped in from the parent environment. Given this function:
test_func = function() {
if (exists("kat") == FALSE) {
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
2007 Jan 14
1
Questions about paste and assign
Hi,
I would like to assign a value to a member b of the list a in position 3, by calling:
assign( target, 2.34, 3)
My question is what the "target" should be. I tried target <- paste("a", $, "b") and something else,
but haven't got the right answer yet.
BTW, if I attached a list named
2007 Apr 01
1
Keep R packages in the R installation
Hi,
I just got a quick question here, when I install a new version of R , is there an easy to keep the installed R packages ?
Thanks a lot for any help.
tong
2010 May 14
2
Restrict access to variables in parent environment
Hello All,
By default, a reference of a variable in a function cause R to look
for the variable in the parent environment if it is not available in
the current environment (without generating any errors or warnings).
I'm wondering if there is a way to revert this behaviors, such that it
will not look for the parent environment and will generate an error if
the variable is not available in the