Re: [R] Lexical scoping is not what I expect

2013-06-24 Thread David Kulp
Indeed, I misread / misunderstood. I think it's a difficult concept that's hard to explain and the example wasn't great. But thanks all for straightening me out! — David Kulp On Mon, Jun 24, 2013 at 6:44 PM, Duncan Murdoch wrote: > On 13-06-24 4:27 PM, David Kulp wrot

[R] Lexical scoping is not what I expect

2013-06-24 Thread David Kulp
According to http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-scope.pdf and other examples online, I am to believe that R resolves variables using lexical scoping by following the frames up the call stack. However, that's not working for me. For example, the following code, taken

[R] Weird RefClass running time

2013-05-10 Thread David Kulp
Anyone have a clue why assigning to a list field in a RefClass is so much slower than assigning to a plain old list? For example, given a list of length N, if I want to assign a value to each entry, then the running time is quadratic in N. That is, refclass$a.list[[i]] <- value is much much slowe

Re: [R] Size of a refClass instance

2013-05-05 Thread David Kulp
tware/Embedded Controllers) .OO#. .OO#. rocks...1k > --- > Sent from my phone. Please excuse my brevity. > > David Kulp wrote: > >> Good tip. Thanks Morgan. >> I agree that a different structure might (necessarily) be in order. I >> wa

Re: [R] Size of a refClass instance

2013-05-03 Thread David Kulp
things with specialized behavior -- but this isn't R's strength. On May 2, 2013, at 4:57 PM, Martin Morgan wrote: > On 05/01/2013 11:20 AM, David Kulp wrote: >> I'm using refClass for a complex multi-directional tree structure with >> possibly 100,000s of nodes

Re: [R] R does not subset

2013-05-03 Thread David Kulp
You have an extra space in the INFECTION factors. Use REC2[REC2$INFECTION=="Infected ",] or subset(REC2, INFECTION=="Infected ") No need to use which here. On May 3, 2013, at 5:48 AM, Katarzyna Kulma wrote: > Hi everyone, > > I know there have been several requests regarding subsetting before,

[R] Size of a refClass instance

2013-05-01 Thread David Kulp
I'm using refClass for a complex multi-directional tree structure with possibly 100,000s of nodes. The refClass design is very impressive and I'd love to use it, but I've found that the size of refClass instances are very large and creation time is slow. For example, below is a RefClass and no

Re: [R] merging or joining 2 dataframes: merge, rbind.fill, etc.?

2013-02-26 Thread David Kulp
On Feb 26, 2013, at 9:33 PM, Anika Masters wrote: > Thanks Arun and David. Another issue I am running into are memory > issues when one of the data frames I'm trying to rbind to or merge > with are "very large". (This is a repetitive problem, as I am trying > to merge/rbind thousands of small

Re: [R] Writing escaped unicode

2012-12-11 Thread David Kulp
ect.org > > > On Mon, Dec 10, 2012 at 11:46:40PM -0500, David Kulp wrote: >> I'd like to write unicode strings using the "\u" escape syntax. According >> to the documentation, print.default or encodeString will escape unicode >> using the \u convention.

[R] Writing escaped unicode

2012-12-10 Thread David Kulp
I'd like to write unicode strings using the "\u" escape syntax. According to the documentation, print.default or encodeString will escape unicode using the \u convention. In practice, I can't make it work. > b="Unicode character: \ufffd" > print.default(b) [1] "Unicode character: �" > encodeSt