Re: [R] Problems with strsplit

2007-09-10 Thread xavierab

You could directly use

strsplit("bA531F16-rep","\\-")[[1]][1]
and 
strsplit("bA531F16-rep","\\-")[[1]][2]

Regards


Carlos Morales-2 wrote:
> 
> Hello,
>
>   I would like to know what can I do if I use strplit with a string and I
> want to use the middle left,I mean I have this:
>
>   strsplit("bA531F16-rep","\\-")
>   [[1]]
> [1] "bA531F16" "rep"
>   I would like to work just with bA531F16 in another variable, what could
> I do?, Thank you
>
> 
>
> -
> 
> Sé un Mejor Amante del Cine
> ¿Quieres saber cómo? ¡Deja que otras personas te ayuden!.
> 
>   [[alternative HTML version deleted]]
> 
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problems-with-strsplit-tf4412525.html#a12594380
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Problems with strsplit

2007-09-10 Thread Moshe Olshansky
> unlist(strsplit("bA531F16-rep","\\-"))[1]
[1] "bA531F16"

--- Carlos Morales <[EMAIL PROTECTED]>
wrote:

> Hello,
>
>   I would like to know what can I do if I use
> strplit with a string and I want to use the middle
> left,I mean I have this:
>
>   strsplit("bA531F16-rep","\\-")
>   [[1]]
> [1] "bA531F16" "rep"
>   I would like to work just with bA531F16 in another
> variable, what could I do?, Thank you
>
> 
>
> -
> 
> Sé un Mejor Amante del Cine
> ¿Quieres saber cómo? ¡Deja que otras personas te
> ayuden!.
> 
>   [[alternative HTML version deleted]]
> 
> > __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained,
> reproducible code.
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Problems with strsplit

2007-09-09 Thread Carlos Morales
Hello,
   
  I would like to know what can I do if I use strplit with a string and I want 
to use the middle left,I mean I have this:
   
  strsplit("bA531F16-rep","\\-")
  [[1]]
[1] "bA531F16" "rep"
  I would like to work just with bA531F16 in another variable, what could I 
do?, Thank you
   

   
-

Sé un Mejor Amante del Cine
¿Quieres saber cómo? ¡Deja que otras personas te ayuden!.

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.