nombre de Jorge I Velez
> Enviado el: miƩrcoles, 30 de enero de 2013 10:50
> Para: Mat
> CC: r-help@r-project.org
> Asunto: Re: [R] substring from behind
>
> Hi Mat,
>
> The following should get you started:
>
> > s <- "Mercedes_02352"
> > substr(s, nc
From: Mat
To: r-help@r-project.org
Cc:
Sent: Wednesday, January 30, 2013 4:05 AM
Subject: [R] substring from behind
Hello together,
i have a question for "substring".
I know i can filter a number like this one:
bill$No<-substring(bill$Customer,2,4)
in this case i get the 2nd, 3rd an
Hi Mat,
The following should get you started:
> s <- "Mercedes_02352"
> substr(s, nchar(s) - 3, nchar(s) - 1)
[1] "235"
>
> # defining a function
> foo <- function(x, a = 3, b = 1) substr(s, nchar(x) - a, nchar(x) - b)
> foo(s)
[1] "235"
HTH,
Jorge.-
On Wed, Jan 30, 2013 at 8:05 PM, Mat <> wr
Hello together,
i have a question for "substring".
I know i can filter a number like this one:
bill$No<-substring(bill$Customer,2,4)
in this case i get the 2nd, 3rd and 4th number of my Customer ID.
But how can i do this, if i want the 2nd, 3rd and 4th number of a column.
Like this one.
I have:
4 matches
Mail list logo