On Wed, Jan 23, 2013 at 5:17 PM, Michael Sumner <mdsumner@gmail.com> wrote:

> "Better" depends on what was required, which wasn't specified - all
> the coordinates, or just 1-d arrays of the unique ones. Our answers
> are totally different, Thiago I trust that you see the difference?
>
> It would be good if xFromCol / yFromRow had defaults for their second
> argument to return all if colnr/rownr are not specified.
>
> Robert: do you think that's a reasonable modification?  (Or are their
> already other functions for that?) :)
>

I think that is reasonable. I'll implement that, Thanks, Robert




>
> Cheers, Mike.
>
> On Thu, Jan 24, 2013 at 12:33 AM, Barry Rowlingson
> <b.rowlingson@lancaster.ac.uk> wrote:
> > On Wed, Jan 23, 2013 at 12:06 AM, Michael Sumner <mdsumner@gmail.com>
> wrote:
> >> You can just do
> >>
> >> xy <- coordinates(r1)
> >>
> >> which gives a 2-column matrix with
> >>
> >> lon <- xy[,1]
> >> lat <- xy[,2]
> >>
> >> Note that for largish rasters this is a considerable amount of data,
> >> and it's mostly all redundant since you can generate it from the
> >> resolution and extent, so you might need to consider other options.
> >
> >  Better to use xFromCol and yFromRow!
> >
> > xFromCol(r,1:ncol(r))
> > yFromRow(r,1:nrow(r))
> >
> >  should do the job.
> >
> > Barry
>
>
>
> --
> Michael Sumner
> Hobart, Australia
> e-mail: mdsumner@gmail.com
>

	[[alternative HTML version deleted]]

