Re: [R] indexing by empty string (was RE: Error in predict.randomForest ... subscript out of bounds with NULL name in X)

2012-02-01 Thread Ista Zahn
Hi Andy, On Tuesday, January 31, 2012 08:44:13 AM Liaw, Andy wrote: I'm not exactly sure if this is a problem with indexing by name; i.e., is the following behavior by design? The problem is that names or dimnames that are empty seem to be treated differently, and one can't index by them:

Re: [R] indexing by empty string (was RE: Error in predict.randomForest ... subscript out of bounds with NULL name in X)

2012-02-01 Thread Liaw, Andy
Hi Ista, When you write a package, you have to anticipate what users will throw at the code. I can insist that users only input matriices where none of the column names are empty, but that's not what I wish to impose on the users. I can add the name if it's empty, but as a user I don't want

[R] indexing by empty string (was RE: Error in predict.randomForest ... subscript out of bounds with NULL name in X)

2012-01-31 Thread Liaw, Andy
I'm not exactly sure if this is a problem with indexing by name; i.e., is the following behavior by design? The problem is that names or dimnames that are empty seem to be treated differently, and one can't index by them: R junk = 1:3 R names(junk) = c(a, b, ) R junk a b 1 2 3 R junk[] NA