Exporting map predictions to tiff file from R

42 views
Skip to first unread message

Jordan Engelbrecht

unread,
Aug 7, 2024, 11:35:26 AM8/7/24
to Wallace Ecological Modeling App
Good morning, 

I am wondering if anyone perhaps knows how to export a map projection from R to QGIS (convert html to tiff)? 

Thank you

Wallace Ecological Modeling App

unread,
Aug 7, 2024, 12:09:13 PM8/7/24
to Wallace Ecological Modeling App

Wallace includes the option to download the prediction as a .tif. If it is incorrectly downloading as an html, perhaps with an error message, try restarting R and your browser. Make sure you have the following packages installed and updated: sf, mapview, webshot, raster.

Alternatively, if you are running code from the RMD, you can add the following line after you map the prediction:
raster::writeRaster(..., "/file/path/where/you/want/the/file/saved/NameYourFile.tif") 
Don't forget to include the .tif at the end. Here is an example based on the screenshot you sent in the other post.
raster::writeRaster(predSel_Pp, "/file/path/where/you/want/the/file/saved/prediction_Pp.tif") 

This will save it as a tif which can be opened using the raster upload in QGIS. The color ramp we use in Wallace is inverted RdYlBu.

Bethany

Reply all
Reply to author
Forward
0 new messages