Get XYZ list from Raster object

Viewed 3723

I know that for getting a raster from and XYZ list (where x and y are numeric vectors of coords and z is a numeric matrix) I can use directly the function raster. But what if I have a raster and I want to get an XYZ list? Is there a simple function already developed on the raster package?

Of course, I know that I can build a list indexing the different levels on the raster object, but I found that I have to make some reversions to achieve it, so I wonder to know if there is a simple and efficient way.

Thanks.

3 Answers
Related