[R-sig-Geo] moving average along transects

Pierre Roudier pierre.roudier at gmail.com
Wed Jun 8 10:16:36 CEST 2011


Hi Raphael,

As I wrote you off-list, it is quite easy to create SpatialLines from
your transects points.

Then, the function over() allows you to overlay those SpatialLines
with your SpatialPointsDataFrame. But that would only give you the
mean for each transect - I *don't think that's what you want.

Maybe an easier way to go would be to:

- compute the point-to-point distance using spDist()
- consider your transect like a time serie, with the point-to-point
distance computed above.
- smooth your pseudo-time-serie using a moving average (I think the
zoo package does that), or any other smoother (spline, kernel
density...)
- add the smooth data  as a new attribute of your SpatialPointsDataFrame object.

Untested - just my 12 cents,

Pierre



2011/6/8  <Raphael.Viscarra-Rossel at csiro.au>:
> Hello
>
> I have a spatial dataset that is made up of 60 transects (of different lengths and not all are straight) across a large area and I want to filter the data along each transect using moving averages.
>
> The data is in a SpatialPointsDataframe with 30,000 obs (rows) and 50 variables (cols). There are no Ids for the transects…although it would not be hard to add them…
>
> I would like to filter the data from each of the 50 variables along these transects.
>
> There are no IDs for the transects and each transect can only be identified by their coordinates.
>
> Any ideas on how I might do this will be appreciated?
>
> Best wishes
>
> Raphael
>
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org<mailto:R-sig-Geo at r-project.org>
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Scientist
Landcare Research, New Zealand



More information about the R-sig-Geo mailing list