Dear Adam,

Many thanks for your suggestion. I supposed I have to create the rasters from my environmental predictor first in GIS and import them in R (to have a rastersStack), or can I create them in R? I read the manual of the raster package but this is not very clear to me.

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<http://www.nephrops.eu>
________________________________
From: Adam Sparks [adamhsparks@gmail.com]
Sent: 13 April 2013 03:56
To: Lauria, Valentina
Cc: r-sig-geo@r-project.org
Subject: Re: [R-sig-Geo] produce a map in ARCGIS from a GAM output

Dear Lauria,
I've used a GAM to do some modelling work with global climate data sets.

Using the predict() from the raster package makes it very simple. Create your GAM as an object in R and plug that into predict() for the function. You will then end up with raster outputs that can be exported from R and imported into ArcGIS.



On Fri, Apr 12, 2013 at 10:06 PM, Lauria, Valentina <valentina.lauria@nuigalway.ie<mailto:valentina.lauria@nuigalway.ie>> wrote:

Hi All,

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 know that maybe the raster package can be useful 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<http://www.nephrops.eu>

________________________________________
From: b.rowlingson@gmail.com<mailto:b.rowlingson@gmail.com> [b.rowlingson@gmail.com<mailto:b.rowlingson@gmail.com>] on behalf of Barry Rowlingson [b.rowlingson@lancaster.ac.uk<mailto:b.rowlingson@lancaster.ac.uk>]
Sent: 12 April 2013 14:15
To: Lauria, Valentina
Cc: r-help@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@nuigalway.ie<mailto:valentina.lauria@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

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org<mailto:R-sig-Geo@r-project.org>
https://stat.ethz.ch/mailman/listinfo/r-sig-geo




--
--
Adam Sparks
Plant Pathologist and GIS Specialist
IRRI
DAPO Box 7777, Metro Manila, Philippines
ph: +63(2) 580-5600


	[[alternative HTML version deleted]]

