I have data on various climate variables in acsii grid format. I have imported data into R using

Rainfall<-read.asciigrid("E:/R Learning Project/Rainfall.txt")

and then used plot(Rainfall) to plot the Rainfall density on the map of UK (since the data is of UK climate).

I want to run a Generalized Linear Model for the presence of a plant species in a specific area of UK (in order to identify the climatic variable/s responsible for the presence of that species and subsequently apply that model in other parts of UK to predict the presence of the plant specie under study).

At this point I have two issues:

  1. the ascii grid file I've imported contains data of Rainfall, Temperature and other variables for whole of the UK but I only need values of these variables for only a specific region of UK.
  2. how can I extract values of all these variables for the region of my interest and then put them together to run a GLM model?

I can understand that I'm asking for a lot of answer but it would be of great help if I can receive a even a brief hint towards the right direction.

  • I'm not very experienced with this (yet :) ), but i think everithing you need is in this book: Species distribution modeling with R – Oto Kaláb Feb 1 '17 at 21:54
  • Suggest you use the raster package to read, mask, and get the data for your GLM instead of sp package... – Spacedman Feb 1 '17 at 22:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.