Re: [Rd] Scope problem?

2009-05-22 Thread Duncan Murdoch
On 22/05/2009 3:02 PM, Barry Rowlingson wrote: On Fri, May 22, 2009 at 6:04 PM, Duncan Murdoch wrote: Putting force(xl); force(yl) into your interpOne definition (so they get executed when interpOne is called, not just when the returned function is called) should work. *sigh* yes, that look

[Rd] Strange install key for R

2009-05-22 Thread Gabor Grothendieck
One user of my batchfiles http://batchfiles.googlecode.com found they did not find the R registry key because it mysteriously was at hklm\software\wow6432Node. The system was a 64 bit system. I've always seen the key at hklm\software\R-core\R which is what the batchfiles assume. Has there been so

Re: [Rd] Scope problem?

2009-05-22 Thread Barry Rowlingson
On Fri, May 22, 2009 at 6:04 PM, Duncan Murdoch wrote: > Putting force(xl); force(yl) into your interpOne definition (so they get > executed when interpOne is called, not just when the returned function is > called) should work. *sigh* yes, that looks like it. The help for "force" gives a more

Re: [Rd] Scope problem?

2009-05-22 Thread Duncan Murdoch
On 5/22/2009 12:28 PM, Barry Rowlingson wrote: I've just spent today trying to fix a Heisenbug... this function returns a linear interpolator function: interpOne <- function(xl,yl){ f = function(data){ t = (data-min(xl))/(max(xl)-min(xl)) return(min(yl)+t*(max(yl)-min(yl))) } retu

[Rd] Scope problem?

2009-05-22 Thread Barry Rowlingson
I've just spent today trying to fix a Heisenbug... this function returns a linear interpolator function: interpOne <- function(xl,yl){ f = function(data){ t = (data-min(xl))/(max(xl)-min(xl)) return(min(yl)+t*(max(yl)-min(yl))) } return(f) } > k=interpOne(c(0,1),c(4,5)) > k(0.5) [1

Re: [Rd] file descriptor leak in getSrcLines in R 2.10.0 svn 48590

2009-05-22 Thread Duncan Murdoch
On 5/22/2009 11:17 AM, William Dunlap wrote: ... The idea is that if the srcfile is already open, then it should be left open; but if it is not open, it should be closed at the end. open() on an open srcfile is supposed to make no change to the srcfile, just return the already open connecti

Re: [Rd] file descriptor leak in getSrcLines in R 2.10.0 svn 48590

2009-05-22 Thread Duncan Murdoch
On 5/21/2009 2:17 PM, William Dunlap wrote: I noticed the following file descriptor leak when I couldn't remove a package unless I shut down the R session that had loaded and used it. The function that triggered the problem printed the output of a call to parse(). Each time one prints a srcref

Re: [Rd] file descriptor leak in getSrcLines in R 2.10.0 svn 48590

2009-05-22 Thread William Dunlap
> ... > The idea is that if the srcfile is already open, then it > should be left > open; but if it is not open, it should be closed at the end. > open() on > an open srcfile is supposed to make no change to the srcfile, just > return the already open connection. > > > (It looks like the sr

Re: [Rd] file descriptor leak in getSrcLines in R 2.10.0 svn 48590

2009-05-22 Thread Duncan Murdoch
On 5/21/2009 2:17 PM, William Dunlap wrote: I noticed the following file descriptor leak when I couldn't remove a package unless I shut down the R session that had loaded and used it. The function that triggered the problem printed the output of a call to parse(). Each time one prints a srcref

Re: [Rd] install.packages now intentionally references .Rprofile?

2009-05-22 Thread Heather Turner
I had a similar problem when moving to R-2.9.0 as my .Rprofile called update.packages(). The solution was to use if(interactive()) { utils:::update.packages(ask = FALSE) } HTH, Heather Mark Kimpel wrote: > This was my original post, with the code example only slightly modified by > Mart