Hi,

I have this string, in which I want to extract some of it's element:

> x <- "Best-K Gene 11340 211952_at RANBP5  Noc= 3 - 2  LL= -963.669 -965.35"

yielding this array

[1] "211952_at"  "RANBP5" "2"



In Perl we would do it this way:

__BEGIN__
my @needed =();
my $str = "Best-K Gene 11340 211952_at RANBP5  Noc= 3 - 2  LL=
-963.669 -965.35";
$str =~ /Best-K Gene \d+ (\w+) (\w+) Noc= \d - (\d) LL= (.*)/;
push @needed, ($1,$2,$3);
__END___

How can we achieve this with R?

 - E.W.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to