[R] strsplit and forward slash '/'

Federico Calboli f.calboli at imperial.ac.uk
Wed Aug 3 18:55:29 CEST 2011


On 3 Aug 2011, at 17:41, Duncan Murdoch wrote:

> 
> It looks as though your my.data[1,1] value is a factor, not a character value.
> 
> strsplit(as.character(my.data[1,1]), "/")

Thanks Duncan, this solved it.

Best 

Federico


> 
> would work, or you could avoid getting factors in the first place, using the stringsAsFactors argument when you create the dataframe.
> 
> Duncan Murdoch
> 
> 
>> Any advice will be gratefully received.
>> 
>> Best wishes,
>> 
>> Federico
>> 
>> 
>> --
>> Federico C. F. Calboli
>> Department of Epidemiology and Biostatistics
>> Imperial College, St. Mary's Campus
>> Norfolk Place, London W2 1PG
>> 
>> Tel +44 (0)20 75941602   Fax +44 (0)20 75943193
>> 
>> f.calboli [.a.t] imperial.ac.uk
>> f.calboli [.a.t] gmail.com
>> 
>> ______________________________________________
>> 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.
> 

--
Federico C. F. Calboli
Department of Epidemiology and Biostatistics
Imperial College, St. Mary's Campus
Norfolk Place, London W2 1PG

Tel +44 (0)20 75941602   Fax +44 (0)20 75943193

f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com



More information about the R-help mailing list