On Mar 16, 2010, at 9:50 AM, arnaud chozo wrote:
> Hi all,
>
> I have a string vector like that: x=c("1\t\t", "2", "3\t\t\t")
> I need to remove all the occurrences of "\t", in order to obtain: x = "1"
> "2" "3"
>
> I'm trying to use the function substring2, and it works for each component,
>
Hi!
It's just this easy:
x=gsub("\t","",x)
For more complex things, it's worth learning some regular expressions
syntax.
Miguel
On Tue, Mar 16, 2010 at 2:50 PM, arnaud chozo wrote:
> Hi all,
>
> I have a string vector like that: x=c("1\t\t", "2", "3\t\t\t")
> I need to remove all the occurrenc
Hi Arnaud,
how about this:
x=c("1\t\t", "2", "3\t\t\t")
gsub("\t","",x)
hth.
arnaud chozo schrieb:
Hi all,
I have a string vector like that: x=c("1\t\t", "2", "3\t\t\t")
I need to remove all the occurrences of "\t", in order to obtain: x = "1"
"2" "3"
I'm trying to use the function substr
Hi all,
I have a string vector like that: x=c("1\t\t", "2", "3\t\t\t")
I need to remove all the occurrences of "\t", in order to obtain: x = "1"
"2" "3"
I'm trying to use the function substring2, and it works for each component,
for example:
substring2(x[1], "\t") =""
gives x = "1" "2" " 3\
4 matches
Mail list logo