[R-sig-Geo] create data frame after spDists

2012-08-24 Thread swagath navin
Hello all, I have two spatial points data frame df1 showing sample locations and df2 meteorological stations. I am interested in finding met stations closer to the sample stations and creating a separate data frame with sample locations and the nearest met station. I calculated the distances

[R-sig-Geo] create data frame after spDists (re-posted)

2012-08-24 Thread swagath navin
Hello all, sorry for re-posting, but i got a scrub message for my first mail. I have two spatial points data frame df1 showing sample locations and df2 meteorological stations. I am interested in finding met stations closer to the sample stations and creating a separate data frame with sample

Re: [R-sig-Geo] How to speed up calculating proportion of landcover classes falling within larger pixels?

2012-08-24 Thread Lyndon Estes
Hi, To follow up on my last with an update. I modified the code a bit to run with my data and set it on its way on our linux server. It seemed to be running, and after the 3 days or so it took to go through all iterations, it failed on me. Here's the contents of the .Rout file: R version

[R-sig-Geo] shortest path

2012-08-24 Thread Francis P. Boscoe
Hi, I've been poking around igraph and spatgraphs but have not been able to find a sufficiently simple example to make sense of. Suppose I have three points A, B, and C. The path from A to B is 3 units, from B to C is 4 units, and from A to C is 8 units. Could someone provide a simple coding

Re: [R-sig-Geo] create data frame after spDists (re-posted)

2012-08-24 Thread Rolf Turner
I believe that you would find the tools in the spatstat package (e.g. crossdist()) useful. cheers, Rolf Turner On 25/08/12 00:24, swagath navin wrote: Hello all, sorry for re-posting, but i got a scrub message for my first mail. I have two spatial points data frame df1 showing

Re: [R-sig-Geo] How to speed up calculating proportion of landcover classes falling within larger pixels?

2012-08-24 Thread Robert J. Hijmans
Lyndon, Please supply a self contained example (with generated data) with questions like this. That is very easy to do in this case (create two overlapping RasterLayer objects with different cell sizes). This is not just to make it easier to answer your question. I is also the way I would write

Re: [R-sig-Geo] How to speed up calculating proportion of landcover classes falling within larger pixels?

2012-08-24 Thread Lyndon Estes
Hi Robert, Many thanks for your quick answer on this. I will test this out. Sorry, I should have re-provided the example I sent in my first email with this. It has generated datasets, but I didn't put NA values in them, so it was slightly different than what I ran with my actual data. In any

Re: [R-sig-Geo] Count frequency of values in a rasterbrick object

2012-08-24 Thread Robert J. Hijmans
Thiago, What I am doing wrong? 1) you are not supplying a self-contained reproducible example (very easy to do in this case). 2) This message: Error in FUN(newX[, i], ...) : unused argument(s) (na.rm = TRUE) will go away if you do: fun - function(x, ...) {x - freq(x)} 3) But that won't fix

Re: [R-sig-Geo] create data frame after spDists (re-posted)

2012-08-24 Thread Robert J. Hijmans
Navin, I think you can achieve that like this: mnd - apply(dist, 1, which.min) cbind(coordinates(df1), coordinates(df2)[mnd, ]) Robert On Fri, Aug 24, 2012 at 5:24 AM, swagath navin swagathna...@gmail.comwrote: Hello all, sorry for re-posting, but i got a scrub message for my first mail.