Displaying 20 results from an estimated 8000 matches similar to: "eval in parent frame: scoping rule confusion"
2018 Feb 15
1
RV: Problem_graphic
Hi everyone,
I am beginner using R but I try to learn more.
I need this graphic or similar but instead of tropical and temperate are three ontogenetic states
Larva Met Juv
CTMAX
CTMIN
SP SP SP
This is my scrip:
Ex = subset(Expr, Outlayer=="N")
Ex2 = subset (Ex, S0 == 1)
Ex3
2010 Sep 15
5
is Intel VT-d "really" necessary?
Hi all,
I'm just curios and would like some input from the community on this
one. We're busy budgeting for a couple of new servers and I thought it
would be good to try out the Core i7 CPU's, but see the majority of
them don't offer VT-d, but just VT-x. Looking at the LGA1366 range,
only the "Intel lga1366 i7 980XE" (from the list of what our suppliers
stock) have VT-d,
2004 Nov 18
5
Lexical Scoping: eval(expr,envir=)
Hi R-listers,
I am trying to better undertand what we would call "functional paradigm"
use of S/R to better map my programming activities in other languages.
This little function is aimed to create an object (at the end end, it would
have it's own class):
--
myObject =function(){
list(
a=1,
foo=function(b)
{
cat("b:",b)
2005 May 16
5
xbox asterisk?
http://www.pbs.org/cringely/pulpit/pulpit20050512.html
interesting comment this week about the Xbox - any intelligent thoughts
here?
I know the price point puts it above most users Asterisk outlay (I run
mine on a $100 P3 -800)
But interesting to see what happens if people start running video
conferencing etc on their home asterisk servers, and lets face it where
else can you buy this
2003 Jan 29
1
Scoping rule problem -- solved
Thanks to some comments from Brian D. Ripley, I found my error:
I should not have given a data argument to lm() after creating a
formula-object. This obviously confused things...
Thanks again, I've really learnt again a bit more on R-programming...
Cheers, Winfried
---------------------------------------------------------------------
E-Mail: Winfried Theis <theis at
2005 Nov 18
2
about eval and eval.parent
x<-1
f<-function(){
x<-3
eval(substitute(x+y,list(y=10)))
}
f() #13
x<-1
f<-function(){
x<-3
eval(substitute(x+y,list(y=10)), envir = sys.frame(sys.parent()))
}
f() #11
x<-1
f<-function(){
x<-3
eval.parent(substitute(x+y,list(y=10)))
}
f()#11
the help page says:
"If 'envir' is
not specified, then 'sys.frame(sys.parent())', the
2012 Feb 08
4
SIP hardware phones
I'm trying to understand why vendors keep making 100Mbps integrated 1-port switches in their hardware SIP phones. Even the recently-announced D40 and D50 Digium phones are limited to 100Mbps. Only the more expensive models (like the D70) can run at 1000Mbps.
However, you can't expect a firm with hundreds of extensions to buy the most expensive model...
And gigabit speed is important when
2002 Sep 04
3
strange things with eval and parent frames
Dear mailing list,
I have found some strange behaviour which I think relates to parent frames
and eval. Can anyone explain what's going on here?
First example:
> test.parent.funcs_ function() {
outer.var_ 5
subfunc1_ function() substitute( outer.var, envir=parent.frame())
print( subfunc1())
subfunc2b_ function() eval( quote( outer.var), envir=parent.frame())
print(
2009 Aug 07
1
eval parent.frame() twice
Hi
I want to use a function (update) that in its body uses
eval(call, parent.frame())
I would like to use this function in a function that does not contain
the variables referred to in 'call'. Those variables are instead in the
parent.frame() of my function (named 'second' below)
Like this:
a <- 2
evalu <- function(obj) {
call <- obj$call
eval(call, parent.frame())
}
2013 Jul 13
1
Alternative to eval(cl, parent.frame()) ?
Dear developeRs,
I maintain a package 'pls', which has a main fit function mvr(), and
functions plsr() and pcr() which are meant to take the same arguments as
mvr() and do exactly the same, but have different default values for the
'method' argument. The three functions are all exported from the name
space.
In the 'pre namespace' era, I took inspiration from lm() and
2009 Jun 12
0
.doTrace problem with eval.parent(substitute(expr)) vs. lazy evaluation of expr
Here are a couple of problems with the use of
eval.parent(substitute(expr))
instead of just lazily evaluating expr in the .doTrace function used by
trace.
(a) In S+ I sometimes use trace() to see how long a function takes
to run with a tracer expression the saves the start time and calls
on.exit to report the difference between the start and end times
when the trace function ends. E.g.,
>
2013 Jun 28
3
problem with eval(..., parent.frame(1L)) when package is not loaded
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The lmer() function in the lme4 package has some code of the form
mc <- match.call()
mc[[1]] <- as.name("lFormula")
lmod <- eval(mc, parent.frame(1L))
this is a fairly common idiom in R, found e.g. in lm(), used when
one wants to pass all of the arguments of a function to a different
function (in the case of lm() it's
2003 Apr 28
4
how to present a table in powerpoint?
Hi,
I have a nicely printed table of results generated by R's
> print(myresult)
where myresult is a "data frame".
I am trying to put this table into a powerpoint slide for presentation without re-typing and re-formating, i.e.,
present it as it is in the R window. This saves time when there are a lot of tables to be presented.
I tried
> sink("myresult.txt")
>
2003 Oct 09
0
Scoping Rules: Summary
Thanks to Andy Liaw, Roger Peng, Thomas Lumley, Brian Ripley and Peter
Dalgaard, all of whom addressed my questions or threads arising from
them. The full messages were posted to the list so this is a brief
summary:
Andy Liaw explained the difference between lexical and dynamic scoping
and the rationale behind the choice of lexical scoping for R. Roger
Peng showed how to modify fnB. Brian
2006 Aug 17
0
confused about scoping in controller when using render
Hi. Can anyone tell me why I cannot access the testmethod inside my
change controller? Thanks very much for any help. I get an undefined
method error. If I call the method outside the render :update (as in
the comments) it works fine. Thanks very much.
---- view ----
<%= javascript_include_tag :defaults %>
<div id="result">testing</div>
<%= link_to_remote
2003 Mar 17
1
scoping rules
Hi
I recently found a bug that was isomorphic to the following:
ll1 <- 2
increment <- function(x)
{
l11 <- 1
return(x+ll1) #bug here
}
Of course, R is obeying the scoping rules just fine, but I'm evidently
not setting the do.what.I.mean.not.what.I.say variable correctly.
Now, how do I avoid making this type of error? ... and what is the
best tool for tracking it down?
--
2003 Dec 03
5
add a point to regression line and cook's distance
Hi,
This is more a statistics question rather than R question. But I thought people on this list may have some pointers.
MY question is like the following:
I would like to have a robust regression line. The data I have are mostly clustered around a small range. So
the regression line tend to be influenced strongly by outlier points (with large cook's distance). From the application
's
2006 Sep 08
1
has_many relationship extensions and scoping rules
Hi all !
Is this supposed to work ?
class Email < ActiveRecord::Base
has_many :to, :class_name => 'Recipient', :conditions =>
"recipients.source = 'to'" do
def create!(*args)
with_scope(:create => {:source => 'to'}) do
super
end
end
def build(*args)
with_scope(:create => {:source => 'to'}) do
2014 Dec 08
2
[Bug 10995] New: rsync -aFF crashes when parent directory of source directory has a .rsync-filter file with a dir-merge rule in it
https://bugzilla.samba.org/show_bug.cgi?id=10995
Bug ID: 10995
Summary: rsync -aFF crashes when parent directory of source
directory has a .rsync-filter file with a dir-merge
rule in it
Product: rsync
Version: 3.1.0
Hardware: x64
OS: Linux
Status: NEW
Severity:
2004 Sep 09
4
scoping rules
Can someone help me with this simple example?
sq <- function() {
y <- x^2
y
}
myfunc <- function() {
x <- 10
sq()
}
myfunc()
executing the above in R yields:
> myfunc()
Error in sq() : Object "x" not found
I understand that R's scoping rules cause it to look for "x" in the
environment in which "sq" was defined (the global environment in