similar to: understanding lexical scope

Displaying 20 results from an estimated 4000 matches similar to: "understanding lexical scope"

2008 Dec 18
1
understanding recursive functions
I'm trying to understand the use of recursive functions described on page 45 of An Introduction to R by the R core development team. A function is a list of expressions, which all get executed with only the last being assigned to a global variable, right? So if a function refers recursively to itself, it should simply start with the first expression and go from there. At least that is my
2009 Feb 02
1
executing R batch files
The following command, issued from the DOS command prompt (running Windows XP), produces the intended result of a .csv file created by program.R: ?c:\program files\R\R-2.8.0\bin\Rterm.exe? --save < "c:\TEMP\program.R" However, when I create a file called Rbatch.bat that contains exactly the line above, and try to execute it (by double clicking or via the Shell command in an Excel
2009 Feb 11
1
Hollander's test of bivariate symmetry
Does anyone know if any R package has a function that will conduct Hollander's test of bivariate symmetry? (Hollander, Biometrika, 1971) Either the exact test or an asymptotic version would be sufficient for my purposes. Thanks. Joe Boyer Statistical Sciences Renaissance Bldg 510, 3233-D Mail Stop RN0320 8-275-3661 cell: (610) 209-8531 [[alternative HTML version deleted]]
2009 Jan 14
1
referring to calls in functions
The first program generates an error message and does not execute the regression of y on x. x<-1:10; y<-rnorm(10) + x; prac <- function( model, wghts ){ lm(model, weights = wghts) } prac(model = y~x, wghts = rep(1, 10)) But the next program works: x<-1:10; y<-rnorm(10) + x; prac <- function( y, x, wghts ){ lm(y~x,
2009 Feb 06
0
RExcel waiting for OLE action
When I run a macro that uses RExcel, I get a dialog box that says "Microsoft Excel is waiting for another application to complete an OLE action." There is no error in the RExcel commands in the macro, of that I am sure. The box appears to be related to the inclusion of RunRFile commands. The macro will run through the second RunRFile command, but will not execute the
2011 Jan 19
2
how to get old packages to work on R 2.12.1
I just installed R 2.12.1, and when I went to run a few old programs with it, nothing worked. I got a ton of error messages saying such and such package was built before R 2.10.0 and needed to be reinstalled. These were not just warning messages, but error messages that prevent the programs from running when they were running just fine with R 2.10.1 For some of those packages, such as deSolve, I
2010 Nov 17
1
Lexical Scope: How does it work?
Let me start by saying that I am a fan of lexical scoping as a way of increasing confidence in your execution models. I am hoping to move from the now thoroughly debunked "wackyscope" model that used to plague many programming languages over to proper lexical scoping in my puppet configs. I''m just having trouble finding documentation of how this works for puppet. I understand
2002 Aug 06
1
Questions about lexical scope
Dear R-users, The numerical integration example given in Gentleman and Ihaka (2000), "Lexical Scope and Statistical Computing," JCGS, 9, 491-508, is very interesting and helpful in understanding how lexical scope is about. However, I got some questions that I just can't figure out. First all, allow me to copy the two functions given by the authors: midpoint <- function(f, a,
2003 Apr 22
3
lexical scope
Hi everyone another documented feature that was a bit unexpected for me: R> x <- 19 R> f <- function(t){t+x} R> f(100) [1] 119 --as expected: x is visible from within f() ..but... R> g <- function(a){x <- 1e99 ; return(f(a))} R> g(4) [1] 23 --the "x" that is visible from within g() is just 19, which is not the one I expected it to find. R> rm(x)
2004 Sep 01
1
Advice on good programming practice, lexical scope
In "An Introduction to R" (See R help menu), there is an example of a function 'open.account' that makes use of the lexical scope in R. I have a set of functions that can be used to output R tables and graphics into a single report document. (I am aware that several tools can do this already). While reorganizing my code, I realize that I can collect my functions in a list, in
2004 Mar 10
1
Question concerning library function "nlme" and lexical scoping
I am running into problems calling the library function nlme from within another function. Basically,the following function (with v a list containing data and initialization values) > testfunc function(dat=v) { test<-nlsList(result~a+(b-a)/(1+(conc/(c+z*cdiff))^d) |rep,start=dat$init,data=dat$mixeddat) return(nlme(test,random=b~1)) } produces the error message Error in eval(expr, envir,
2023 Mar 18
1
lexical scoping for scripts......
On 18/03/2023 1:57 p.m., akshay kulkarni wrote: > Dear members, > The documentation for source() says: > > Input is read and parsed from that file until the end of the file is reached, then the parsed expressions are evaluated sequentially in the chosen environment. > > What does this mean? I presume that any objects that are CREATED by the script
2015 Nov 18
3
RFC: Supporting all entities declared in lexical scope in LLVM debug info
Hi, I would like to implement a fix to how LLVM handles/creates debug info for entities declared inside a basic block. Below you will find 5 parts: 1. Motivation for this fix. 2. Background explaining the cases that need to be fixed. 3. An example for each case. 4. Proposal on how to represent each case in dwarf. 5. Secondary (workaround) proposal which might be
2016 Jan 19
2
RFC: Supporting all entities declared in lexical scope in LLVM debug info
On Mon, Dec 14, 2015 at 7:01 AM, Aboud, Amjad via llvm-dev < llvm-dev at lists.llvm.org> wrote: > Hi, > > I verified that GDB 7.10 does support “DW_AT_abstract_origin” attribute on > “DW_TAG_lexical_block”. > I take it you mean that it does the right thing, finding the direct children of the abstract block when stepping into the inlined subroutine, etc? & this was a
2003 Feb 28
2
Lexical scoping question
Hello, Could someone please tell me what I am thinking about incorrectly: f <- function(y) { g <- function(x) x + y g } In the following, I get what I expect based on my understanding of lexical scoping: (f(1))(3) # 4 (f(2))(3) # 5 But now, fs <- lapply(c(1, 2), f) fs[[1]](3) # 5 (Why not 4 ?) fs[[2]](3) # 5 Checking the environments of these functions, I see that
2023 Mar 19
1
lexical scoping for scripts......
On 19/03/2023 2:33 p.m., akshay kulkarni wrote: > Dear Duncun, > ? ? ? ? ? ? ? ? ? ? ? ? ?thanks for the reply.... > > So when I run a script in the system command line by R CMD BATCH, the > objects created in the script cannot be stored in the workspace ,right? > If yes, how to save them? Moreover, the only way to save the objects > CREATED from the script permanently is
2023 Mar 19
1
lexical scoping for scripts......
On 19/03/2023 2:55 p.m., akshay kulkarni wrote: > Dear Duncun, > ? ? ? ? ? ? ? ? ? ? ? ? ?What if there is no interactive "session" > running? I will be running my scripts automatically from crontab in Linux. I was talking about the session that is created for the duration of the BATCH run, not some other session that may be running in another process. Sorry for the
2023 Mar 19
1
lexical scoping for scripts......
Dear Duncun, thanks for the reply.... So when I run a script in the system command line by R CMD BATCH, the objects created in the script cannot be stored in the workspace ,right? If yes, how to save them? Moreover, the only way to save the objects CREATED from the script permanently is to save them to the disk, right? THanking you, yours sincerely, AKSHAY M KULKARNI
2023 Mar 18
1
lexical scoping for scripts......
Dear members, The documentation for source() says: Input is read and parsed from that file until the end of the file is reached, then the parsed expressions are evaluated sequentially in the chosen environment. What does this mean? I presume that any objects that are CREATED by the script are stored in the Global environment (if local = FALSE), but the rules for
2023 Mar 19
2
lexical scoping for scripts......
Dear Duncun, What if there is no interactive "session" running? I will be running my scripts automatically from crontab in Linux. THanking you, Yours sincerely, AKSHAY M KULKARNI ________________________________ From: Duncan Murdoch <murdoch.duncan at gmail.com> Sent: Monday, March 20, 2023 12:20 AM To: akshay kulkarni <akshay_e4 at hotmail.com>; R