[R] produce a map in ARCGIS from a GAM output
Lauria, Valentina
valentina.lauria at nuigalway.ie
Fri Apr 12 15:58:52 CEST 2013
Dear Barry,
Thank you very much for your reply. I am trying to create a map in GIS of the habitat prediction of lobster using environmental predictors. I am attaching here a brief example of my script and data.
I am OK for the GAM fitting and evaluation (residuals plot etc) but I am having problems to create a prediction map (raster of my GAM output) in GIS. In particular when I run predict.gam I get a set of values which I guess are the probability of lobster densities in function of my environmental predictors, but I do not know how to geo-reference these points. I will read about the raster package as I have to extrapolate my predictions for a larger area (where we have no data). Any help and suggestion is very much appreciated.
Best Regards,
Valentina
Dr. Valentina Lauria
Postdoctoral researcher
Room 118, Martin Ryan Institute
Department of Earth and Ocean Sciences
National University of Ireland, Galway
Ireland
www.nephrops.eu
________________________________________
From: b.rowlingson at gmail.com [b.rowlingson at gmail.com] on behalf of Barry Rowlingson [b.rowlingson at lancaster.ac.uk]
Sent: 12 April 2013 14:15
To: Lauria, Valentina
Cc: r-help at R-project.org
Subject: Re: [R] produce a map in ARCGIS from a GAM output
On Fri, Apr 12, 2013 at 10:37 AM, Lauria, Valentina
<valentina.lauria at nuigalway.ie> wrote:
> Hi,
>
> I am trying to predict the habitat suitability of lobster with GAMs. I need to produce a map in ArcGis of the predicted densities. I did some search and the function predict.gam seems to do the job.
>
> Is this the right way to do it? when you apply the function you get the predicted values (different from your input data points) but I do not understand what is the procedure with the spatial coordinates, I mean what lat and long have the new points? Can I use the same ones of my observations?
I suspect you'll get a better response if you:
a) ask on R-sig-geo, the mailing list for all things R and mappy
b) try and ask with a reproducible example - it doesn't have to be
your data, but something similar, and small, and that we can run to
get a better idea of your problem. Show us how you are running
predict.gam, at least, and what your data looks like.
To get data from R into ArcGIS you probably want to either use the
raster package to create a grid of values, or the rgdal package to
create a shapefile of point locations and estimates. Exactly how you
get that from your predict.gam results is a bit guesswork until we
know a bit more about how you are running predict.gam....
Barry
More information about the R-help
mailing list