dear users, we have got the following question: we have got a text-file looking like this: ... <trkpt lat="48.272000" lon="16.342984"> <ele>387</ele> <time>2012-01-01T15:32:03Z</time> <sat>9</sat> </trkpt> <trkpt lat="48.271909" lon="16.343563"> <ele>381</ele> <time>2012-01-01T15:32:34Z</time> <sat>9</sat> </trkpt> ... now we would like to create a text file looking like the following, in order to being able to read it into R afterwards. -> lat;lon;ele;time;sat 48.272000;16.342984;387;2012-01-01T15:32:03Z;9 48.271909;16.343563;381;2012-01-01T15:32:34Z;9 ... does anyone know how to do this? thank you very much for your help in advance. marion [[alternative HTML version deleted]]
On Mon, Jan 2, 2012 at 3:31 PM, Marion Wenty <marion.wenty at gmail.com> wrote: .> ?<trkpt lat="48.272000" lon="16.342984"> > ? ?<ele>387</ele> > ? ?<time>2012-01-01T15:32:03Z</time> > ? ?<sat>9</sat> > ?</trkpt> > ?<trkpt lat="48.271909" lon="16.343563"> > ? ?<ele>381</ele> > ? ?<time>2012-01-01T15:32:34Z</time> > ? ?<sat>9</sat> > ?</trkpt> > ... > > now we would like to create a text file looking like the following, in > order to being able to read it into R afterwards. > > -> > > lat;lon;ele;time;sat > 48.272000;16.342984;387;2012-01-01T15:32:03Z;9 > 48.271909;16.343563;381;2012-01-01T15:32:34Z;9 > ... > > does anyone know how to do this?That looks suspiciously like a chunk of a GPX format file - GPS tracks, that kind of thing. Am I right? If so, then get the rgdal package, and read it in. You'll end up with a spatial data frame of some kind from which you can get the points and times. http://en.wikipedia.org/wiki/GPS_eXchange_Format Barry
we haven't had time to create the file again, yet, but thanx also for the great tip about this special mailing list! marion 2012/1/3 Barry Rowlingson <b.rowlingson@lancaster.ac.uk>> On Tue, Jan 3, 2012 at 10:54 AM, Marion Wenty <marion.wenty@gmail.com> > wrote: > > hello barry, > > > > thank you very much for your help! > > > > we managed to do what you said and it basicaly worked - there only is a > > problem with our file, but we will create the file again and then it > should > > work completely. i will keep you posted how it turned out. thanks again! > > Great - you might get more help from the R-sig-geo mailing list, > where we tend to talk about spatial data a bit more than on R-help! > > Barry >[[alternative HTML version deleted]]