Re: [R] Extracting xy from raster based on raster value

2009-02-23 Thread Michelle Greve
/message.php?msg_id=1269 Regards, Michelle - Original Message From: Kingsford Jones To: Michelle Greve Cc: R-help@r-project.org Sent: Sunday, February 22, 2009 7:32:58 PM Subject: Re: [R] Extracting xy from raster based on raster value Hi Michelle, The r-sig-geo list would be the ideal place

Re: [R] Extracting xy from raster based on raster value

2009-02-22 Thread Kingsford Jones
Hi Michelle, The r-sig-geo list would be the ideal place for this question since the authors of 'raster' would be likely to see it. I haven't used the raster package before, but this seems to work: #install.packages("raster", repos="http://R-Forge.R-project.org";) r <- raster() r <- setValues(r

[R] Extracting xy from raster based on raster value

2009-02-22 Thread Michelle Greve
I have a raster (which I called glc), which I read into R as a raster with "raster.create.from.file" from the raster package (R-forge). Values in glc range between 1 and 27 (whole numbers only). I'd like to extract all cells with a value of 1 to create a new raster with only the cells that have a