[R] Odp: How to separate the string?

Petr PIKAL petr.pikal at precheza.cz
Tue Jul 7 10:12:47 CEST 2009


Hi

r-help-bounces at r-project.org napsal dne 07.07.2009 09:54:30:

> Hi everyone,
> Hi want to separate the string(column1) for example

Well, how did you get the data in R? Are they in separated columns of 
data.frame? What do you mean by "separate"?

> 
> column1 column2 column3 column4 column5 column6
> bear           b           e             a          r
> cat             c           a              t
> tiger            t           i               g          e           r
> 
> I know how to do this in excel where using MID function.

As Microsoft is more user friendly and uses translated functions in 
language specific versions of Excel I do not have function MID. I suspect 
it takes values from middle of string set by some identifiers. If it is 
the case see

?substr

However I would start with

?read.table

and related read.* functions to get the data into R in appropriate shape.

Regards
Petr


> Now I want to solve it using R. The list of strings is in text file. I
> looked up the help but did not find it.
> Can someone help me here?
> 
> Thank you very much.
> 
> Regards,
> Hema
> 
>    [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org 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.




More information about the R-help mailing list