Delete all characters up to and including the last hyphen with
sub(".*-", "", test)
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Thu, Aug 28, 2014 at 10:41 AM, Jun Shen wrote:
> Hi everyone,
>
> I believe I am not the first one to have this problem but couldn't find a
> relevant thread o
Thanks for everyone who replied with those wonderful solutions!
Jun
On Thu, Aug 28, 2014 at 2:11 PM, Enrico Schumann
wrote:
> On Thu, 28 Aug 2014, Jun Shen writes:
>
> > Hi everyone,
> >
> > I believe I am not the first one to have this problem but couldn't find a
> > relevant thread on the l
On Thu, 28 Aug 2014, Jun Shen writes:
> Hi everyone,
>
> I believe I am not the first one to have this problem but couldn't find a
> relevant thread on the list.
>
> Say I have a string (actually it is the whole column in a data frame) in a
> format like this:
>
> test<- 'AF14-485-502-89-00235'
>
On Aug 28, 2014, at 12:41 PM, Jun Shen wrote:
> Hi everyone,
>
> I believe I am not the first one to have this problem but couldn't find a
> relevant thread on the list.
>
> Say I have a string (actually it is the whole column in a data frame) in a
> format like this:
>
> test<- 'AF14-485-502
Here's one way:
R> test<- 'AF14-485-502-89-00235'
R> test2 <- strsplit(test, "-")
R> test2
[[1]]
[1] "AF14" "485" "502" "89""00235"
R> test2[[1]][length(test2[[1]])]
[1] "00235"
On Thu, Aug 28, 2014 at 1:41 PM, Jun Shen wrote:
> Hi everyone,
>
> I believe I am not the first one to have
Hi everyone,
I believe I am not the first one to have this problem but couldn't find a
relevant thread on the list.
Say I have a string (actually it is the whole column in a data frame) in a
format like this:
test<- 'AF14-485-502-89-00235'
I would like to split the test string and keep the last
6 matches
Mail list logo