Extracting bioclim data using R

716 views
Skip to first unread message

billsu...@gmail.com

unread,
Oct 30, 2013, 10:35:15 AM10/30/13
to max...@googlegroups.com
This question isn't directly related to Maxent, but it has to do with the extraction of bioclim variables for use in Maxent.  I am currently using the biovars code in the R dismo package to extract these data from the newest IPCC 5 climate projections.  It took about 2 days of processing time, but I was able to "successfully" extract the data for one of the scenarios.  However, I can't get gis to recognize the .grd/.gri file that R produced.  Anyone out there have any advice/success on/with this process?

Thanks,

Bill 

Mike Treglia

unread,
Oct 30, 2013, 12:13:52 PM10/30/13
to max...@googlegroups.com, max...@googlegroups.com
Hi Bill,
.gri/grd files are an R format (as far as I understand). You could either writeRaster (Raster package) to export each layer separately as a format compatible with your GIS (there's an argument like "by layer" that let's you write all layers to separate files in one step, but I'm not near my comp to look that up). Alternatively write the layer stack to a format that natively handles multilayered rasters (e.g. GeoTiff), if your GIS can deal with that. Again, using writeRaster.
Hope that helps
Mike


--
You received this message because you are subscribed to the Google Groups "Maxent" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maxent+un...@googlegroups.com.
To post to this group, send email to max...@googlegroups.com.
Visit this group at http://groups.google.com/group/maxent.
For more options, visit https://groups.google.com/groups/opt_out.

billsu...@gmail.com

unread,
Oct 30, 2013, 1:10:53 PM10/30/13
to max...@googlegroups.com
Mike,

Yep, currently trying to do this.  R gave a raster brick output with all 19 layers tied up in the brick.  Does the "by layer" argument allow you to pull out each of the 19 layers?  I had also read that "subset" will do something similar.

Thanks!

Michael Treglia

unread,
Oct 30, 2013, 1:17:06 PM10/30/13
to max...@googlegroups.com
Yup, If I remember correctly, the "by layer" argument allows you to write out each of the 19 layers, and it uses the filename followed by the number of the layer as R sees it. Here's an example of my cod from some PRISM data I was working with.
writeRaster(stack, filename="71TMnCr.asc", format="ascii", bylayer=TRUE)
Hope that helps,
Mike



--
Reply all
Reply to author
Forward
0 new messages