Displaying 2 results from an estimated 2 matches for "stringvector".
Did you mean:
string_vector
2007 Oct 23
1
grep with "|" character
Hi,
I am having a problem searching for the "|" character in a string.
> grep("|",stringvector)
Gives all the strings in a vector but when I try to escape it
> grep("\|",stringvector)
It comes up with the error
Warning messages:
1: '\|' is an unrecognized escape in a character string
2: unrecognized escape removed from "\|"
Anyone know how to solve this?
Dan...
2010 Jan 13
3
counting the number of times a string appears
Hi all,
I have a vector of strings and need to count the number of times a string
appears in the vector.
eg:
[1] spp6 spp10 spp6 spp6 spp4 spp2 spp9 spp10 spp5 spp2 spp2 spp3
[13] spp4 spp3 spp6 spp10 spp6 spp4 spp9 spp3 spp6 spp1 spp10 spp8
[25] spp2 spp10 spp9 spp7 spp1 spp3 spp8 spp6 spp3 spp8 spp6 spp5
[37] spp5 spp9 spp3 spp1 spp4 spp5 spp9 spp3