Displaying 2 results from an estimated 2 matches for "yourpattern".
2009 May 14
3
memory usage grows too fast
Hi All,
I have a 1000x1000000 matrix.
The calculation I would like to do is actually very simple: for each row, calculate the frequency of a given pattern. For example, a toy dataset is as follows.
Col1 Col2 Col3 Col4
01 02 02 00 => Freq of ?02? is 0.5
02 02 02 01 => Freq of ?02? is 0.75
00 02 01 01 ?
My code is quite simple as the following to find the pattern ?02?.
2010 Aug 22
4
how to implement string pattern extraction in R
Hi,
In perl, to get a substring matching a particular pattern can be
implemented like the following example:
$x = "AAAA.txt";
if ($x=~ /(.*?)\.txt/){
$prefix = $1;
}
So how to do the same thing in R?
Can someone provide me the code sample?
Thanks much in advance.
--
Waverley @ Palo Alto