[R] strsplit a matrix

2009-08-10 Thread James Perkins
Dear all, I am trying to split a matrix into 2 as efficiently as possible. It is a character matrix: 1 2 3 1 2-271 2-367 1-79 2 2-282 2-378 1-90 3 2-281 2-377 1-89 I want to make 2 matrices from this, as succinctly and efficiently as possible. I've tried such things as

[R] subsetting data-frame by vector of characters

2008-06-13 Thread james perkins
Hi, I have a very simple problem but I can't think how to solve it without using a for loop and creating a large logical vector. However given the nature of the problem I am sure there is a 1-liner that could do the same thing much more efficiently. bascially I have a dataframe with

Re: [R] subsetting data-frame by vector of characters

2008-06-13 Thread james perkins
. Is there an easy way to re-index the table? Kind regards Jim Wacek Kusnierczyk wrote: james perkins wrote: Hi, I have a very simple problem but I can't think how to solve it without using a for loop and creating a large logical vector. However given the nature of the problem I am sure there is a 1