Try this:
lines <- "77.56787,22.09909,0 73.26787,21.09909,0 76.53487,23.09909,0 75.56787,22.09909,0 76.54587,22.09909,0 76.56787,22.03509,0 75.56457,22.05609,0 76.56787,22.05609,0" ln <- readLines(textConnection(lines)) t(sapply(strsplit(ln, "(,)|(,0+)"), as.numeric)) On Fri, Sep 12, 2008 at 9:08 AM, Ajay ohri <[EMAIL PROTECTED]> wrote: > Hi All, > > I have the following data in one column for each row , (each value is > like x1,y1,z1 space x2,y2,z2 space....) > > 77.56787,22.09909,0 73.26787,21.09909,0 > 76.53487,23.09909,0 75.56787,22.09909,0 > 76.54587,22.09909,0 76.56787,22.03509,0 > 75.56457,22.05609,0 76.56787,22.05609,0 > > Note all z values are O (hence ,0 can be treated as a delimiter) > > How do I split this column into multiple columns for each row. > > Regards, > Ajay > > www.decisionstats.com > > ______________________________________________ > R-help@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. > -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
______________________________________________ R-help@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.