[R] syntax for reading into R

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon Jan 2 16:54:37 CET 2012


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



More information about the R-help mailing list