[R] regexp help needed.

2009-08-28 Thread Carlos Gonzalo Merino Mendez
Hi, I posted yesterday with a problem in a script. I still have the same problem, but I think I found a better way to explain my problem. I have a vector of character strings. Each string is unique, including numbers and letters. In the real world they represent a list of codes, so each

Re: [R] regexp help needed.

2009-08-28 Thread Carlos Gonzalo Merino Mendez
, value = TRUE) split(Str, substr(Str, 1, 1)) On Fri, Aug 28, 2009 at 7:29 AM, Carlos Gonzalo Merino Mendez carlosgmerin Hi, I posted yesterday with a problem in a script. I still have the same problem, but I think I found a better way to explain my problem. I have a vector of character strings

[R] subset of a matrix

2009-08-27 Thread Carlos Gonzalo Merino Mendez
Hello everyone, I would appreciate any help with the following. My dataset is a list containing matrices. So if you type e.g. data[[1]] you get something like: [,1][,2] 361a AT 456b AG 72145aTG As you can see my rows have names which are

Re: [R] subset of a matrix

2009-08-27 Thread Carlos Gonzalo Merino Mendez
Hi Milton, Thanks for trying to help anyway. From: milton ruser milton.ru...@gmail.com Cc: r-help@r-project.org Sent: Thursday, August 27, 2009 6:48:41 PM Subject: Re: [R] subset of a matrix Hi Carlos, I think I made a wrong suggestion. Sorry about that.

Re: [R] subset of a matrix

2009-08-27 Thread Carlos Gonzalo Merino Mendez
this: lapply(data, function(r) lapply(split(r, substr(sprintf(%05d, as.numeric(gsub([a-z], , row.names(r, 1, 3)), table)) On Thu, Aug 27, 2009 at 1:27 PM, Carlos Gonzalo Merino Mendez carlosgmerin Hello everyone, I would appreciate any help