[R] Fwd: Evaluating a function within a pre-defined environment?

2009-12-09 Thread David Reiss
Hi all, I have a somewhat confusing question that I was wondering if someone could help with. I have a pre-defined environment with some variables, and I would like to define a function, such that when it is called, it actually manipulates the variables in that environment, leaving them to be exam

Re: [R] Fwd: Evaluating a function within a pre-defined environment?

2009-12-09 Thread David Reiss
t; > library(proto) > p <- proto(x = 2, f = function(this, a) { this$x <- this$x + a; this$x }) > p$f(3) # 5 > > > On Wed, Dec 9, 2009 at 4:54 PM, David Reiss wrote: >> Hi all, >> >> I have a somewhat confusing question that I was wondering if someone &g

[R] read in large data file (tsv) with inline filter?

2009-03-23 Thread David Reiss
I have a very large tab-delimited file, too big to store in memory via readLines() or read.delim(). Turns out I only need a few hundred of those lines to be read in. If it were not so large, I could read the entire file in and "grep" the lines I need. For such a large file; many calls to read.delim

Re: [R] read in large data file (tsv) with inline filter?

2009-03-24 Thread David Reiss
d, > > On 23 March 2009 at 15:09, Dylan Beaudette wrote: > | On Monday 23 March 2009, David Reiss wrote: > | > I have a very large tab-delimited file, too big to store in memory via > | > readLines() or read.delim(). Turns out I only need a few hundred of > those > | >

[R] Basic matrix math question and avoiding additional memory allocation?

2010-02-02 Thread David Reiss
I was not able to find this being specifically addressed previously, so I thought I'd try starting a new thread: I am dealing with a bunch of big matrices and basic mathematics, such as x <- x + y * 3 where x and y are large matrices of the same dimension. I now realize that when I perform the a

[R] escape character OK in R environment, fails in R CMD CHECK

2010-05-21 Thread David Reiss
Hi, I am trying to check a package via R CMD CHECK and it is failing with Error: '\s' is an unrecognized escape in character string starting "\s" The culprit looks something like this: gsub('\\s\\(.*\\)',"","this is a (test, man) dude") which is correctly escaped with the "\\"'s -- but it see

Re: [R] escape character OK in R environment, fails in R CMD CHECK

2010-05-22 Thread David Reiss
Ah, you are right, it is in one of my Rd file, not in my actual code. Sorry for the misunderstanding, and thanks for the solution. -David 2010/5/22 Uwe Ligges > > > On 22.05.2010 08:18, Henrik Bengtsson wrote: > >> R version/sessionInfo()? >> >> /H >> >&g

[R] Profiling code with lots of 'apply' calls?

2009-01-21 Thread David Reiss
Hi, I have some code with a bunch of apply/sapply/lapply calls to different functions. I am trying to profile it using Rprof, however the resulting summary looks like this (output from 'R CMD Rprof'): % total % self totalseconds selfsecondsname 100.00 14.5