Subscribe to R-sig-geo feed
This is an archive for R-sig-geo, not a forum. It is not possible to post through Nabble - you may not start a new thread nor follow up an existing thread. If you wish to post, but are not subscribed to the list through the list homepage, subscribe first (through the list homepage, not via Nabble) and post from your subscribed email address. Until 2015-06-20, subscribers could post through Nabble, but policy has been changed as too many non-subscribers misunderstood the interface.
Updated: 5 days 8 hours ago

Re: WorldClim Version2

Wed, 10/11/2017 - 19:04
Wonderful. Thanks.

On 10/11/17, 10:31 AM, "Alex Mandel" <[hidden email]> wrote:

    It uses WorldClim 1.4
   
    The paper for WorldClim 2 was recently published and we are still
    working on adding more additional variables and refinements. I expect
    the getData function to be updated in the near future.
   
    Thanks,
    Alex
   
    On 09/28/2017 12:44 AM, Marcelino de la Cruz Rot wrote:
    > I'm afraid it don't.
    >
    > At least in version 2.5.8, as it  appears from  this line in .wordclim():
    >
    >  theurl <-
    > paste("http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/",
    >             zip, sep = "")
    >
    > Marcelino
    >
    >
    > El 28/09/2017 a las 4:31, Bacou, Melanie escribió:
    >>
    >> I would assume `raster::getData("worldclim", ...)` uses WorldClim
    >> version 2?
    >>
    >> --Mel.
    >>
    >>
    >> On 09/25/2017 05:14 PM, Andy Bunn wrote:
    >>> Great. Thanks Marcelino. I have all the data dowloaded. I'm surprised
    >>> that
    >>> there isn't a dedicated package for worldclim yet ‹ making one that ties
    >>> in with packages like BIEN would be great. Perhaps I'll work on it
    >>> someday.
    >>>
    >>> -A
    >>>
    >>> On 9/25/17, 11:32 AM, "Marcelino de la Cruz Rot"
    >>> <[hidden email]>  wrote:
    >>>
    >>>> Hello Andy,
    >>>>
    >>>> I've been using raster to play with WordlClim 2.0 and it works fine.
    >>>> For
    >>>> example:
    >>>>
    >>>> # Download 2.5' arc P data of worldclim 2.0
    >>>> # The file is 68.5 MB so it takes some time to download
    >>>> P_url<-
    >>>> "http://biogeo.ucdavis.edu/data/worldclim/v2.0/tif/base/wc2.0_2.5m_prec.zi
    >>>> p"
    >>>> download.file(P_url, destfile="wc2.0_2.5m_prec.zip")
    >>>> unzip("wc2.0_2.5m_prec.zip")
    >>>>
    >>>> #  Generate a stack object  with all monthly precipitation layers
    >>>> P_filenames<- paste("wc2.0_2.5m_prec_", c(paste(0,1:9, sep=""), 11,12),
    >>>> ".tif",sep="")
    >>>>
    >>>> prec2.5<- stack(P_filenames)
    >>>>
    >>>> # Compute annual precipitation as a raster layer
    >>>> P2.5<- sum(prec2.5)
    >>>>
    >>>> # etc.
    >>>>
    >>>> Cheers,
    >>>>
    >>>> Marcelino
    >>>>
    >>>>
    >>>> El 25/09/2017 a las 19:42, Andy Bunn escribió:
    >>>>> Hello all, is anybody aware of a R package that gracefully works with
    >>>>> version 2 of the WorldClim data?
    >>>>>
    >>>>> http://worldclim.org/version2
    >>>>>
    >>>>>
    >>>>> I have all the data extracted locally but I'm wondering if there is
    >>>>> something akin to getData in raster that will work with version 2 and
    >>>>> not
    >>>>> 1.4 as (the brilliant) raster package currently does.
    >>>>>
    >>>>> Many thanks, Andy
    >>>>>
    >>>>> _______________________________________________
    >>>>> R-sig-Geo mailing list
    >>>>> [hidden email]
    >>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
    >>>>> .
    >>>>>
    >>>> --
    >>>> Marcelino de la Cruz Rot
    >>>> Depto. de Biología y Geología
    >>>> Física y Química Inorgánica
    >>>> Universidad Rey Juan Carlos
    >>>> Móstoles España
    >>>>
    >>> _______________________________________________
    >>> R-sig-Geo mailing list
    >>> [hidden email]
    >>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
    >>
    >> .
    >
    >
   
   

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: WorldClim Version2

Wed, 10/11/2017 - 12:30
It uses WorldClim 1.4

The paper for WorldClim 2 was recently published and we are still
working on adding more additional variables and refinements. I expect
the getData function to be updated in the near future.

Thanks,
Alex

On 09/28/2017 12:44 AM, Marcelino de la Cruz Rot wrote:
> I'm afraid it don't.
>
> At least in version 2.5.8, as it  appears from  this line in .wordclim():
>
>  theurl <-
> paste("http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/",
>             zip, sep = "")
>
> Marcelino
>
>
> El 28/09/2017 a las 4:31, Bacou, Melanie escribió:
>>
>> I would assume `raster::getData("worldclim", ...)` uses WorldClim
>> version 2?
>>
>> --Mel.
>>
>>
>> On 09/25/2017 05:14 PM, Andy Bunn wrote:
>>> Great. Thanks Marcelino. I have all the data dowloaded. I'm surprised
>>> that
>>> there isn't a dedicated package for worldclim yet ‹ making one that ties
>>> in with packages like BIEN would be great. Perhaps I'll work on it
>>> someday.
>>>
>>> -A
>>>
>>> On 9/25/17, 11:32 AM, "Marcelino de la Cruz Rot"
>>> <[hidden email]>  wrote:
>>>
>>>> Hello Andy,
>>>>
>>>> I've been using raster to play with WordlClim 2.0 and it works fine.
>>>> For
>>>> example:
>>>>
>>>> # Download 2.5' arc P data of worldclim 2.0
>>>> # The file is 68.5 MB so it takes some time to download
>>>> P_url<-
>>>> "http://biogeo.ucdavis.edu/data/worldclim/v2.0/tif/base/wc2.0_2.5m_prec.zi
>>>> p"
>>>> download.file(P_url, destfile="wc2.0_2.5m_prec.zip")
>>>> unzip("wc2.0_2.5m_prec.zip")
>>>>
>>>> #  Generate a stack object  with all monthly precipitation layers
>>>> P_filenames<- paste("wc2.0_2.5m_prec_", c(paste(0,1:9, sep=""), 11,12),
>>>> ".tif",sep="")
>>>>
>>>> prec2.5<- stack(P_filenames)
>>>>
>>>> # Compute annual precipitation as a raster layer
>>>> P2.5<- sum(prec2.5)
>>>>
>>>> # etc.
>>>>
>>>> Cheers,
>>>>
>>>> Marcelino
>>>>
>>>>
>>>> El 25/09/2017 a las 19:42, Andy Bunn escribió:
>>>>> Hello all, is anybody aware of a R package that gracefully works with
>>>>> version 2 of the WorldClim data?
>>>>>
>>>>> http://worldclim.org/version2
>>>>>
>>>>>
>>>>> I have all the data extracted locally but I'm wondering if there is
>>>>> something akin to getData in raster that will work with version 2 and
>>>>> not
>>>>> 1.4 as (the brilliant) raster package currently does.
>>>>>
>>>>> Many thanks, Andy
>>>>>
>>>>> _______________________________________________
>>>>> R-sig-Geo mailing list
>>>>> [hidden email]
>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>>> .
>>>>>
>>>> -- 
>>>> Marcelino de la Cruz Rot
>>>> Depto. de Biología y Geología
>>>> Física y Química Inorgánica
>>>> Universidad Rey Juan Carlos
>>>> Móstoles España
>>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> [hidden email]
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>> .
>
>
_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Unexpected elevation value when using extract() on RasterLayer

Wed, 10/11/2017 - 11:59
Thanks a lot, Kamil!  That makes a lot of sense.  I really appreciate your
help!

Best,

-Matt.

On Wed, Oct 11, 2017 at 12:45 AM, Kamil Konowalik <[hidden email]>
wrote:

> Hi Matt,
>
> the result you got is correct according to your dataset. You can check it
> quickly for example in QGis. You need to change the source - the map you
> are using is in a very coarse resolution (you can see its accurracy by
> looking at the highest point which should be around 8848 m and in your map
> is 7320 m). You should look for a more detailed map like for example SRTM
> data (I think there are multiple sources to download it). Otherwise you may
> also try "elevatr" package in R.
>
> Good luck!
>
> Kamil
>
>
>
> Dnia 10 października 2017 22:04 Matthew Nelsen <[hidden email]>
> napisał(a):
>
> Hi Everyone,
>
> I'm fairly new to using R to analyze geo data and am getting some
> unexpected values when I try to extract elevation data from a RasterLayer
> using lat/long.  I've downloaded some global elevation data (ESRI ArcView
> Format) from here:
>
> http://nelson.wisc.edu/sage/data-and-models/atlas/maps.php?datasetid=28&
> includerelatedlinks=1&dataset=28
>
> And have read it in using raster and rgdal.  I then am trying to extract()
> the elevation at specific lat/longs and have been getting some strange
> values.  For instance, I try to get the elevation for a point in Samoa
> (-13.86472, -171.77.06), and an elevation of -129m is returned, which is
> incorrect.  Any idea why this might be?  I'm not sure where I'm going wrong
> (or if this specific RasterLayer does not deal well with smaller land
> masses and truly does say it is -129m)? I've tried it two different ways
> (below).
>
> Thanks very much for any help.
>
> All the best,
>
> -Matt.
>
>
> #download elevation data from:
> http://nelson.wisc.edu/sage/data-and-models/atlas/maps.php?datasetid=28&
> includerelatedlinks=1&dataset=28
>
> #click Download a GIS grid of this data (ESRI ArcView Format)
>
>
> ll<-cbind(-171.7706,-13.86472)
>
> #coordinates are inland in Samoa
>
> #https://www.google.com/maps/place/13
> °51'53.0%22S+171°46'14.2%22W/@-13.86472,-171.8034302,13z/
> data=!4m5!3m4!1s0x0:0x0!8m2!3d-13.86472!4d-171.7706
>
>
> require(raster)
>
> #read hdr.adf file
>
> elev<-raster("/...PATH.../elevation/elevation/hdr.adf")
>
> elev
>
>
> #class       : RasterLayer
>
> #dimensions  : 2160, 4320, 9331200  (nrow, ncol, ncell)
>
> #resolution  : 0.08333333, 0.08333333  (x, y)
>
> #extent      : -180, 180, -90, 89.99999  (xmin, xmax, ymin, ymax)
>
> #coord. ref. : NA
>
> #data source :
> /...PATH.../atlas_of_the_biosphere_13sep2017/elevation/elevation/hdr.adf
>
> #names       : hdr
>
> #values      : -10376, 7320  (min, max)
>
> #attributes  :
>
> #           ID COUNT
>
> # from: -10376     1
>
> # to  :   7320     1
>
>
>
> extract(elev,ll)
>
> #-129
>
>
> ####Alternatively, read in...
>
> require(rgdal)
>
> #from
> https://gis.stackexchange.com/questions/132403/how-to-read-
> adf-files-into-r
>
> dpath<-"/...PATH.../elevation/elevation"
>
> x<-new("GDALReadOnlyDataset",dpath)
>
> getDriver(x)
>
> #An object of class "GDALDriver"
>
> #Slot "handle":
>
> #<pointer: 0x60000032ac80>
>
>
> getDriverLongName(getDriver(x))
>
> #[1] "Arc/Info Binary Grid"
>
>
> xx<-asSGDF_GROD(x)
>
> elevation <- raster(xx)
>
> elevation
>
>
> #class       : RasterLayer
>
> #dimensions  : 2160, 4320, 9331200  (nrow, ncol, ncell)
>
> #resolution  : 0.08333333, 0.08333333  (x, y)
>
> #extent      : -180, 180, -90, 89.99999  (xmin, xmax, ymin, ymax)
>
> #coord. ref. : NA
>
> #data source : in memory
>
> #names       : band1
>
> #values      : -10376, 7320  (min, max)
>
>
> extract(elevation,ll)
>
>
> #-129
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
>
        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Odp: Unexpected elevation value when using extract() on RasterLayer

Wed, 10/11/2017 - 00:45
Hi Matt,  the result
you got is correct according to your dataset. You can check it quickly for
example in QGis. You need to change the source - the map you are using is in a
very coarse resolution (you can see its accurracy by looking at the
highest point which should be around 8848 m and in your map is 7320 m). You
should look for a more detailed map like for example SRTM data (I think there are multiple sources to download it). Otherwise you may also try
&#34;elevatr&#34; package in R.   Good luck!  Kamil     Dnia 10 października 2017 22:04 Matthew Nelsen &lt;[hidden email]&gt; napisał(a):  Hi Everyone,   I&#39;m fairly new to using R to analyze geo data and am getting some  unexpected values when I try to extract elevation data from a RasterLayer  using lat/long.  I&#39;ve downloaded some global elevation data (ESRI ArcView  Format) from here:   nelson.wisc.edu nelson.wisc.edu   And have read it in using raster and rgdal.  I then am trying to extract()  the elevation at specific lat/longs and have been getting some strange  values.  For instance, I try to get the elevation for a point in Samoa  (-13.86472, -171.77.06), and an elevation of -129m is returned, which is  incorrect.  Any idea why this might be?  I&#39;m not sure where I&#39;m going wrong  (or if this specific RasterLayer does not deal well with smaller land  masses and truly does say it is -129m)? I&#39;ve tried it two different ways  (below).   Thanks very much for any help.   All the best,   -Matt.    #download elevation data from:  nelson.wisc.edu nelson.wisc.edu   #click Download a GIS grid of this data (ESRI ArcView Format)    ll&lt;-cbind(-171.7706,-13.86472)   #coordinates are inland in Samoa   # www.google.com www.google.com  °51&#39;53.0%22S+171°46&#39;14.2%22W    require(raster)   #read hdr.adf file   elev&lt;-raster(&#34;/...PATH.../elev   elev    #class       : RasterLayer   #dimensions  : 2160, 4320, 9331200  (nrow, ncol, ncell)   #resolution  : 0.08333333, 0.08333333  (x, y)   #extent      : -180, 180, -90, 89.99999  (xmin, xmax, ymin, ymax)   #coord. ref. : NA   #data source :  /...PATH.../atlas_of_the_biosp   #names       : hdr   #values      : -10376, 7320  (min, max)   #attributes  :   #           ID COUNT   # from: -10376     1   # to  :   7320     1     extract(elev,ll)   #-129    ####Alternatively, read in...   require(rgdal)   #from  gis.stackexchange.com gis.stackexchange.com   dpath&lt;-&#34;/...PATH.../elevation/   x&lt;-new(&#34;GDALReadOnlyDataset&#34;,d   getDriver(x)   #An object of class &#34;GDALDriver&#34;   #Slot &#34;handle&#34;:   #&lt;pointer: 0x60000032ac80&gt;    getDriverLongName(getDriver(x)   #[1] &#34;Arc/Info Binary Grid&#34;    xx&lt;-asSGDF_GROD(x)   elevation &lt;- raster(xx)   elevation    #class       : RasterLayer   #dimensions  : 2160, 4320, 9331200  (nrow, ncol, ncell)   #resolution  : 0.08333333, 0.08333333  (x, y)   #extent      : -180, 180, -90, 89.99999  (xmin, xmax, ymin, ymax)   #coord. ref. : NA   #data source : in memory   #names       : band1   #values      : -10376, 7320  (min, max)    extract(elevation,ll)    #-129   [[alternative HTML version deleted]]   ______________________________  R-sig-Geo mailing list   [hidden email]  stat.ethz.ch stat.ethz.ch

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Unexpected elevation value when using extract() on RasterLayer

Tue, 10/10/2017 - 15:04
Hi Everyone,

I'm fairly new to using R to analyze geo data and am getting some
unexpected values when I try to extract elevation data from a RasterLayer
using lat/long.  I've downloaded some global elevation data (ESRI ArcView
Format) from here:

http://nelson.wisc.edu/sage/data-and-models/atlas/maps.php?datasetid=28&includerelatedlinks=1&dataset=28

And have read it in using raster and rgdal.  I then am trying to extract()
the elevation at specific lat/longs and have been getting some strange
values.  For instance, I try to get the elevation for a point in Samoa
(-13.86472, -171.77.06), and an elevation of -129m is returned, which is
incorrect.  Any idea why this might be?  I'm not sure where I'm going wrong
(or if this specific RasterLayer does not deal well with smaller land
masses and truly does say it is -129m)? I've tried it two different ways
(below).

Thanks very much for any help.

All the best,

-Matt.


#download elevation data from:
http://nelson.wisc.edu/sage/data-and-models/atlas/maps.php?datasetid=28&includerelatedlinks=1&dataset=28

#click Download a GIS grid of this data (ESRI ArcView Format)


ll<-cbind(-171.7706,-13.86472)

#coordinates are inland in Samoa

#https://www.google.com/maps/place/13
°51'53.0%22S+171°46'14.2%22W/@-13.86472,-171.8034302,13z/data=!4m5!3m4!1s0x0:0x0!8m2!3d-13.86472!4d-171.7706


require(raster)

#read hdr.adf file

elev<-raster("/...PATH.../elevation/elevation/hdr.adf")

elev


#class       : RasterLayer

#dimensions  : 2160, 4320, 9331200  (nrow, ncol, ncell)

#resolution  : 0.08333333, 0.08333333  (x, y)

#extent      : -180, 180, -90, 89.99999  (xmin, xmax, ymin, ymax)

#coord. ref. : NA

#data source :
/...PATH.../atlas_of_the_biosphere_13sep2017/elevation/elevation/hdr.adf

#names       : hdr

#values      : -10376, 7320  (min, max)

#attributes  :

#           ID COUNT

# from: -10376     1

# to  :   7320     1



extract(elev,ll)

#-129


####Alternatively, read in...

require(rgdal)

#from
https://gis.stackexchange.com/questions/132403/how-to-read-adf-files-into-r

dpath<-"/...PATH.../elevation/elevation"

x<-new("GDALReadOnlyDataset",dpath)

getDriver(x)

#An object of class "GDALDriver"

#Slot "handle":

#<pointer: 0x60000032ac80>


getDriverLongName(getDriver(x))

#[1] "Arc/Info Binary Grid"


xx<-asSGDF_GROD(x)

elevation <- raster(xx)

elevation


#class       : RasterLayer

#dimensions  : 2160, 4320, 9331200  (nrow, ncol, ncell)

#resolution  : 0.08333333, 0.08333333  (x, y)

#extent      : -180, 180, -90, 89.99999  (xmin, xmax, ymin, ymax)

#coord. ref. : NA

#data source : in memory

#names       : band1

#values      : -10376, 7320  (min, max)


extract(elevation,ll)


#-129

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Basic questions about Bayesian Spatio-temporal Analysis-INLA

Tue, 10/10/2017 - 05:09
Hi,


I think that these model is covered in the book by Michela and Marta. You can also check the book by Banerjee et al. on Bayesian spatial models. I think that this will give a better idea of the different models that you could use.

Best,
Virgilio

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Basic questions about Bayesian Spatio-temporal Analysis-INLA

Mon, 10/09/2017 - 18:35
Hi Virgilio,
Thank you for your response and wealth of resources that you sent!
I had originally planned on using the raster files as covariates (went to great pains to get them!) but was swayed away from that approach at some point.

Here is what I have: a number raster stacks of various climatic and geophysical data across a country. Each stack is in the same resolution and each layer represents either the mean, min, max or median of that variable, for a given week. There is a layer for each week of the year, for each variable. As the outcome, I have weekly counts of an infectious disease, aggregated across each county (admin 2) of that country, in each week of the year (weeks that disease counts are aggregated into match the weeks that climatic data is assembled into).
I want my model to predict if there is an association of these climatic variables and the risk of the disease (disease count normalized by the number of residents in that county) and if this association various by different parts of the country...ie different climatic predictors for coastal vs inland. Further, I am interested in measuring if there is a time lag that is predictive of risk increase: i.e. x mm of precipitation predicts an increase in risk of disease 2 weeks later.  

Based on your resources, I believe that a space time geostatistical model would help me to answer these questions- although it is unclear to me if this would work since my outcome is aggregated counties and not points.
Any thoughts on this?
Thank you!
Claire.


-----Original Message-----
From: VIRGILIO GOMEZ RUBIO [mailto:[hidden email]]
Sent: Sunday, October 08, 2017 12:18 AM
To: Quiner, Claire
Cc: [hidden email]
Subject: Re: [R-sig-Geo] Basic questions about Bayesian Spatio-temporal Analysis-INLA

Hi Claire,


Not sure what type of model or data you are trying to fit. If you have raster data, it would make sense to use them as covariates and not as priors. If you definitely want to fit a spatio-temporal model with INLA  you should check this book:

http://eu.wiley.com/WileyCDA/WileyTitle/productCd-1118326555.html

Also, please check these course materials that I prepared for the GEOSTAT 2017 summer school about spatial model fitting with INLA:

https://www.dropbox.com/s/lb9f7eagmmzou5k/materials.zip?dl=0


In a nutshell, the inla() function works similarly as the glm() or gam() functions: you define your model in a formula (which may include random effects) and use a data.frame to pass the data.

Hope this helps.

Virgilio

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Basic questions about Bayesian Spatio-temporal Analysis-INLA

Sun, 10/08/2017 - 02:18
Hi Claire,


Not sure what type of model or data you are trying to fit. If you have raster data, it would make sense to use them as covariates and not as priors. If you definitely want to fit a spatio-temporal model with INLA  you should check this book:

http://eu.wiley.com/WileyCDA/WileyTitle/productCd-1118326555.html

Also, please check these course materials that I prepared for the GEOSTAT 2017 summer school about spatial model fitting with INLA:

https://www.dropbox.com/s/lb9f7eagmmzou5k/materials.zip?dl=0


In a nutshell, the inla() function works similarly as the glm() or gam() functions: you define your model in a formula (which may include random effects) and use a data.frame to pass the data.

Hope this helps.

Virgilio
_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Basic questions about Bayesian Spatio-temporal Analysis-INLA

Fri, 10/06/2017 - 18:28
Greetings,
I am in the process of trying to teach myself how to perform a Bayesian spatio-temporal analysis using INLA in R. I am reading papers and following a number of tutorials but there is one, somewhat basic thing that I can't seem to figure out from my readings.
I have a series of raster stacks of a variety of climatic data, each layer of a stack represents the value from a week in a year. These data will become the prior distributions in my analysis, as I understand it. I was originally under the impression that INLA would read these raster files but I see that the program actually requires tabular data. I can easily transform these raster stacks, getting summary values over each county, by week. However, it is unclear to me what part of the analysis that I should do that in. I would like to prepare a correlation matrix to address multicollinearity, followed by PCA to further eliminate redundant variables. My understanding is that both of these analyses can be done on either raster files or from tabular data. For these preliminary analyses to Bayesian analysis, should I opt for spatial data? Also, how do I handle the temporal nature of this data, which will obviously be correlated, but still may be necessary to maintain?
Any advice would be appreciated.
Thank you,

Claire


        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: WorldClim Version2

Thu, 10/05/2017 - 12:11
Clever! Thanks.

From: Mirza Cengic <[hidden email]<mailto:[hidden email]>>
Date: Wednesday, October 4, 2017 at 10:32 AM
To: Marcelino de la Cruz Rot <[hidden email]<mailto:[hidden email]>>
Cc: Melanie Bacou <[hidden email]<mailto:[hidden email]>>, Andy Bunn <[hidden email]<mailto:[hidden email]>>, R-sig-Geo <[hidden email]<mailto:[hidden email]>>
Subject: Re: [R-sig-Geo] WorldClim Version2

Hi Andy,

for quick and dirty solution you can replace the url that the getData()
function reads for bioclim data. You can find the source code of the
function here https://github.com/cran/raster/blob/master/R/getData.R#L277 (note
that there's if/else flow for different resolutions of climate data). From
there you can make a custom function, or recompile the package if you
prefer it that way.

URL for the bioclimatic layers is
http://biogeo.ucdavis.edu/data/worldclim/v2.0/tif/base/wc2.0_RES_bio.zip,
where "RES" can be 10m, 5m, 2.5m, or 30s, and you'll need to play around a
bit with how the theurl string is being created in relation with the
resolution.

M

On Wed, Oct 4, 2017 at 2:00 PM, Mirza Cengic <[hidden email]<mailto:[hidden email]>> wrote:
Hi Andy,

for quick and dirty solution you can replace the url that the getData() function reads for bioclim data. You can find the source code of the function here <https://github.com/cran/raster/blob/master/R/getData.R#L277> (note that there's if/else flow for different resolutions of climate data). From there you can make a custom function, or recompile the package if you prefer it that way.

URL for the bioclimatic layers is http://biogeo.ucdavis.edu/data/worldclim/v2.0/tif/base/wc2.0_RES_bio.zip, where "RES" can be 10m, 5m, 2.5m, or 30s, and you'll need to play around a bit with how the theurl string is being created in relation with the resolution.

M

On Thu, Sep 28, 2017 at 9:44 AM, Marcelino de la Cruz Rot <[hidden email]<mailto:[hidden email]>> wrote:
I'm afraid it don't.

At least in version 2.5.8, as it  appears from  this line in .wordclim():

 theurl <- paste("http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/",
            zip, sep = "")

Marcelino



El 28/09/2017 a las 4:31, Bacou, Melanie escribió:

I would assume `raster::getData("worldclim", ...)` uses WorldClim version 2?

--Mel.


On 09/25/2017 05:14 PM, Andy Bunn wrote:
Great. Thanks Marcelino. I have all the data dowloaded. I'm surprised that
there isn't a dedicated package for worldclim yet ‹ making one that ties
in with packages like BIEN would be great. Perhaps I'll work on it someday.

-A

On 9/25/17, 11:32 AM, "Marcelino de la Cruz Rot"
<[hidden email]<mailto:[hidden email]>>  wrote:

Hello Andy,

I've been using raster to play with WordlClim 2.0 and it works fine. For
example:

# Download 2.5' arc P data of worldclim 2.0
# The file is 68.5 MB so it takes some time to download
P_url<-
"http://biogeo.ucdavis.edu/data/worldclim/v2.0/tif/base/wc2.0_2.5m_prec.zi p"
download.file(P_url, destfile="wc2.0_2.5m_prec.zip")
unzip("wc2.0_2.5m_prec.zip")

#  Generate a stack object  with all monthly precipitation layers
P_filenames<- paste("wc2.0_2.5m_prec_", c(paste(0,1:9, sep=""), 11,12),
".tif",sep="")

prec2.5<- stack(P_filenames)

# Compute annual precipitation as a raster layer
P2.5<- sum(prec2.5)

# etc.

Cheers,

Marcelino


El 25/09/2017 a las 19:42, Andy Bunn escribió:
Hello all, is anybody aware of a R package that gracefully works with
version 2 of the WorldClim data?

http://worldclim.org/version2


I have all the data extracted locally but I'm wondering if there is
something akin to getData in raster that will work with version 2 and
not
1.4 as (the brilliant) raster package currently does.

Many thanks, Andy

_______________________________________________
R-sig-Geo mailing list
[hidden email]<mailto:[hidden email]>
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
.

--
Marcelino de la Cruz Rot
Depto. de Biología y Geología
Física y Química Inorgánica
Universidad Rey Juan Carlos
Móstoles España

_______________________________________________
R-sig-Geo mailing list
[hidden email]<mailto:[hidden email]>
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

.


--
Marcelino de la Cruz Rot
Depto. de Biología y Geología
Física y Química Inorgánica
Universidad Rey Juan Carlos
Móstoles España

_______________________________________________
R-sig-Geo mailing list
[hidden email]<mailto:[hidden email]>
https://stat.ethz.ch/mailman/listinfo/r-sig-geo



--
Mirza Čengić

Junior Researcher | Department of Environmental Science
Radboud University | Heyendaalseweg 135
6525 AJ Nijmegen | The Netherlands

+31 657020823<tel:+31%206%2057020823> | +38761908392<tel:+387%2061%20908%20392>
Skype: mirzacengic
[http://tecd.client.shareholder.com/common/images/share/linkedin_icon.gif]<https://www.linkedin.com/in/mirzacengic>



--
Mirza Čengić

Junior Researcher | Department of Environmental Science
Radboud University | Heyendaalseweg 135
6525 AJ Nijmegen | The Netherlands

+31 657020823 | +38761908392
Skype: mirzacengic
[http://tecd.client.shareholder.com/common/images/share/linkedin_icon.gif]<https://www.linkedin.com/in/mirzacengic>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: WorldClim Version2

Wed, 10/04/2017 - 12:32
Hi Andy,

for quick and dirty solution you can replace the url that the getData()
function reads for bioclim data. You can find the source code of the
function here https://github.com/cran/raster/blob/master/R/getData.R#L277
(note
that there's if/else flow for different resolutions of climate data). From
there you can make a custom function, or recompile the package if you
prefer it that way.

URL for the bioclimatic layers is
http://biogeo.ucdavis.edu/data/worldclim/v2.0/tif/base/wc2.0_RES_bio.zip,
where "RES" can be 10m, 5m, 2.5m, or 30s, and you'll need to play around a
bit with how the theurl string is being created in relation with the
resolution.

M

On Wed, Oct 4, 2017 at 2:00 PM, Mirza Cengic <[hidden email]> wrote:

> Hi Andy,
>
> for quick and dirty solution you can replace the url that the getData()
> function reads for bioclim data. You can find the source code of the
> function here
> <https://github.com/cran/raster/blob/master/R/getData.R#L277>(note that
> there's if/else flow for different resolutions of climate data). From there
> you can make a custom function, or recompile the package if you prefer it
> that way.
>
> URL for the bioclimatic layers is http://biogeo.ucdavis.edu/
> data/worldclim/v2.0/tif/base/wc2.0_RES_bio.zip, where "RES" can be 10m,
> 5m, 2.5m, or 30s, and you'll need to play around a bit with how the theurl
> string is being created in relation with the resolution.
>
> M
>
> On Thu, Sep 28, 2017 at 9:44 AM, Marcelino de la Cruz Rot <
> [hidden email]> wrote:
>
>> I'm afraid it don't.
>>
>> At least in version 2.5.8, as it  appears from  this line in .wordclim():
>>
>>  theurl <- paste("http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/
>> grid/cur/",
>>             zip, sep = "")
>>
>> Marcelino
>>
>>
>>
>> El 28/09/2017 a las 4:31, Bacou, Melanie escribió:
>>
>>>
>>> I would assume `raster::getData("worldclim", ...)` uses WorldClim
>>> version 2?
>>>
>>> --Mel.
>>>
>>>
>>> On 09/25/2017 05:14 PM, Andy Bunn wrote:
>>>
>>>> Great. Thanks Marcelino. I have all the data dowloaded. I'm surprised
>>>> that
>>>> there isn't a dedicated package for worldclim yet ‹ making one that ties
>>>> in with packages like BIEN would be great. Perhaps I'll work on it
>>>> someday.
>>>>
>>>> -A
>>>>
>>>> On 9/25/17, 11:32 AM, "Marcelino de la Cruz Rot"
>>>> <[hidden email]>  wrote:
>>>>
>>>> Hello Andy,
>>>>>
>>>>> I've been using raster to play with WordlClim 2.0 and it works fine.
>>>>> For
>>>>> example:
>>>>>
>>>>> # Download 2.5' arc P data of worldclim 2.0
>>>>> # The file is 68.5 MB so it takes some time to download
>>>>> P_url<-
>>>>> "http://biogeo.ucdavis.edu/data/worldclim/v2.0/tif/base/wc2.
>>>>> 0_2.5m_prec.zi p"
>>>>> download.file(P_url, destfile="wc2.0_2.5m_prec.zip")
>>>>> unzip("wc2.0_2.5m_prec.zip")
>>>>>
>>>>> #  Generate a stack object  with all monthly precipitation layers
>>>>> P_filenames<- paste("wc2.0_2.5m_prec_", c(paste(0,1:9, sep=""), 11,12),
>>>>> ".tif",sep="")
>>>>>
>>>>> prec2.5<- stack(P_filenames)
>>>>>
>>>>> # Compute annual precipitation as a raster layer
>>>>> P2.5<- sum(prec2.5)
>>>>>
>>>>> # etc.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Marcelino
>>>>>
>>>>>
>>>>> El 25/09/2017 a las 19:42, Andy Bunn escribió:
>>>>>
>>>>>> Hello all, is anybody aware of a R package that gracefully works with
>>>>>> version 2 of the WorldClim data?
>>>>>>
>>>>>> http://worldclim.org/version2
>>>>>>
>>>>>>
>>>>>> I have all the data extracted locally but I'm wondering if there is
>>>>>> something akin to getData in raster that will work with version 2 and
>>>>>> not
>>>>>> 1.4 as (the brilliant) raster package currently does.
>>>>>>
>>>>>> Many thanks, Andy
>>>>>>
>>>>>> _______________________________________________
>>>>>> R-sig-Geo mailing list
>>>>>> [hidden email]
>>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>>>> .
>>>>>>
>>>>>> --
>>>>> Marcelino de la Cruz Rot
>>>>> Depto. de Biología y Geología
>>>>> Física y Química Inorgánica
>>>>> Universidad Rey Juan Carlos
>>>>> Móstoles España
>>>>>
>>>>> _______________________________________________
>>>> R-sig-Geo mailing list
>>>> [hidden email]
>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>>
>>>
>>> .
>>>
>>
>>
>> --
>> Marcelino de la Cruz Rot
>> Depto. de Biología y Geología
>> Física y Química Inorgánica
>> Universidad Rey Juan Carlos
>> Móstoles España
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> [hidden email]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>
>
> --
> *Mirza Čengić*
>
> *Junior Researcher | Department of Environmental Science*
> Radboud University | Heyendaalseweg 135
> 6525 AJ Nijmegen | The Netherlands
>
> +31 657020823 <+31%206%2057020823> | +38761908392 <+387%2061%20908%20392>
> Skype: mirzacengic
> <https://www.linkedin.com/in/mirzacengic>
>


--
*Mirza Čengić*

*Junior Researcher | Department of Environmental Science*
Radboud University | Heyendaalseweg 135
6525 AJ Nijmegen | The Netherlands

+31 657020823 | +38761908392
Skype: mirzacengic
<https://www.linkedin.com/in/mirzacengic>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: Question about the anisotropy factor in the sum metric spatiotemporalcovariance gstat

Wed, 10/04/2017 - 06:44
Dear Sara,

the anisotropy in the metric spatio-temporal covariance models describes
how spatial distances relate to temporal distance (i.e. to answer the
question: At which temporal separation (x hours/days/weeks/...) do have
two locations 1 m/km/... apart the same correlation?). Every model that
includes the metric model has to have a spatio-temporal anisotropy
parameter. For more details, please refer to the vignette of gstat [1].

HTH,

  Ben

[1]
https://cran.r-project.org/web/packages/gstat/vignettes/spatio-temporal-kriging.pdf



On 02/10/2017 10:31, sara osama wrote:
> Dear all.
> I have a question about the sum metric spatiotemporalcovariance function in
> gstat. I need to understand the theoretical background and the meaning of
> the anisotropy (Anis) in it.
> If anyone can help me in this I will be deeply appreciated
> Best regards
> Sara
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> --
Dr. Benedikt Gräler
52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Muenster, Germany

E-Mail: [hidden email]
Fon: +49-(0)-251/396371-39
Fax: +49-(0)-251/396371-11

http://52north.org/
Twitter: @FiveTwoN

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
b_graeler.vcf (458 bytes) Download Attachment

R version 3.3.2, Windows 10: gstat package: Error in fitting a variogram model using 'fit.variogram' function

Wed, 10/04/2017 - 06:03
Hello Everyone,

I am having some problem with fit.variogram  function of the gstat package.  My code, data, error message and traceback() message can be found below. Any suggestion to approach this problem would be appreciated.
# Code Starts---------------------------------------------------------------------------------------------------------------------------------------------------
library(gstat)
mydf<-as.data.frame(read.table("Sample_data.xlsx",header = TRUE,sep = ",",na.strings = "EMPTY"))
coordinates(mydf) = ~x+y
c.vgm.exp<-variogram(z~1,data=mydf,cutoff=60000, width = 60000/15)
c.vgm.fit<-fit.variogram(c.vgm.exp,vgm(nugget=1000000,psill=6000000,model ="Exp",range = 40000),fit.method = 7)
# Code End--------------------------------------------------------------------------------------------------------------------------------------------------------

Data file can be obtained from:
https://gtvault-my.sharepoint.com/personal/srathore6_gatech_edu/_layouts/15/guestaccess.aspx?docid=0b5983d45c9544203a5081cd501c64de4&authkey=AYhC8_ZVvGFG18JHHWMgUa4&expiration=2017-12-01T19%3a45%3a23.000Z

Error Message:
> c.vgm.fit<-fit.variogram(c.vgm.exp,vgm(nugget=1000000,psill=6000000,model ="Exp",range = 40000),fit.method = 7)
Error in switch(model, exponential = fit.exponential(v.object, c0 = nugget,  :
  EXPR must be a length 1 vector
> traceback()
1: fit.variogram(c.vgm.exp, vgm(nugget = 1e+06, psill = 6e+06, model = "Exp",
       range = 40000), fit.method = 7)



Thanks and Regards,

Saubhagya Singh Rathore
1st Year Graduate Student
Civil and Environmental Engineering
Georgia Instutute of Technology


        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

sdm package gam model smoothing

Tue, 10/03/2017 - 16:41
Hello everyone,
I'm working on some species distribution models using the package 'sdm' to
perform the multiple-model k-fold cross validation. But, upon viewing the
results, I'm concerned that smoothing parameters are not being applied to
the gam model formula. Unfortunately, I'm not able to provide you with the
example data, but here's the piece of code I'm working with:

data<-sdmData(pa~SBT+Chla+PAR+Kd+Wave+Depth,train=new_sdmdata)
model1<-sdm(pa~SBT+Chla+PAR+Kd+Wave+Depth, data=data,
family=gaussian(link="logit"),
            methods=c("glm", "gam"),
            replication="sub", test.percent=25, n=5)
getModelInfo(model1)
model1
##This code functions, but does not seem to apply smoothing parameters to
the gam model

model1<-sdm(pa~s(SBT)+s(Chla)+s(PAR)+s(Kd)+s(Wave)+s(Depth), data=data,
            family=gaussian(link="logit"), methods=c("glm", "gam"),
            replication="sub", test.percent=25, n=5)
getModelInfo(model1)
model1
##This piece of code returns: Error in u[[i]] <- list() :
 ## attempt to select less than one element in OneIndex

Does anyone know of the proper way to specify that smoothing parameters be
applied to gam models?
Thank you!
Kelly McCaffrey

--

*Kelly McCaffrey*
Graduate Student
Department of Biological Sciences
Florida Institute of Technology
150 W. University Blvd.
Melbourne, FL, 32901

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: edit.nb problem with an island

Mon, 10/02/2017 - 15:02
How many observations in total? If not to many, edit.nb() should still work, but I doubt that it will work in an IDE like Rstudio.

Roger Bivand
Norwegian School of Economics
Bergen, Norway



Fra: Wheeler-Martin, Katherine
Sendt: mandag 2. oktober, 21.49
Emne: Re: [R-sig-Geo] edit.nb problem with an island
Til: [hidden email]


Dear all, I am encountering an issue related to an old thread from 2011 (pasted below), and would like to know if someone could provide sample code for when one wishes to manually delete contiguity between two points, while retaining all other contiguities for those points. I am relatively new with R, so I apologize if this is obvious! Thank you, Katie Dear Alexander, Following your suggestion I have used this syntax and works perfectly: x.nb[[67]] = as.integer(sort(c(43,53))) x.nb[[43]] = as.integer(sort(c(x.nb[[43]],67))) x.nb[[53]] = as.integer(sort(c(x.nb[[53]],67))) Thank you very much for your help! Marc 2011/5/17 Alexander Werner >: > Dear Marc, > > facing a similar problem I choose to correct the NB object manually: > > NBDKR439[[350]]= as.integer(sort(c(NBDKR439[[350]],362))) > NBDKR439[[362]]= as.integer(350) > > Hope this helps, > Alexander > > > > Am 16.05.2011 19:01, schrieb Marc Mar� Dell'Olmo: >> >> Dear all, >> >> I have a cartography with an island, i.e. a polygon that doesn't share >> border with other polygons (CODIGO=3120104012). I would like to >> manually assign two areas (CODIGO=3120103024 and CODIGO=3120103014) as >> a neighborhood areas of this island with the edit.nb function, and >> after that to obtain the neighborhood matrix. I have followed this >> syntax and I don't understand why the summary(x.nb2) still shows one >> region with no link... >> >> If it helps, you can download the map at: >> http://dl.dropbox.com/u/14934021/map.zip >> >> >> Thank you very much, >> >> Marc >> >> map> map> >> >> x.nb> summary(x.nb) >> >> #Neighbour list object: >> #Number of regions: 122 >> #Number of nonzero links: 724 >> #Percentage nonzero weights: 4.864284 >> #Average number of links: 5.934426 >> #1 region with no links: >> #66 >> #Link number distribution: >> >> #0 2 3 4 5 6 7 8 9 10 11 12 14 >> #1 1 7 19 22 31 21 12 2 2 2 1 1 >> #1 least connected region: >> #101 with 2 links >> #1 most connected region: >> #29 with 14 links >> >> nb> which(card(nb) == 0) >> attr(nb, "region.id")[which(card(nb) == 0)] >> >> >> x.nb2> >> #> x.nb2> #Identifying contiguity for deletion ... >> #No contiguity between chosen points >> #Add contiguity? (y/n) y >> #added contiguity between point 53 and 67 >> #Options: quit[q] refresh[r] continue[c] c >> #Identifying contiguity for deletion ... >> #No contiguity between chosen points >> #Add contiguity? (y/n) y >> #added contiguity between point 43 and 67 >> #Options: quit[q] refresh[r] continue[c] q >> >> >> summary(x.nb2) >> >> #Neighbour list object: >> #Number of regions: 122 >> #Number of nonzero links: 726 >> #Percentage nonzero weights: 4.877721 >> #Average number of links: 5.95082 >> #1 region with no links: >> #66 >> #Non-symmetric neighbours list >> #Link number distribution: >> >> #0 2 3 4 5 6 7 8 9 10 11 12 14 >> #1 1 7 18 22 32 21 12 2 2 2 1 1 >> #1 least connected region: >> #101 with 2 links >> #1 most connected region: >> #29 with 14 links >> >> _______________________________________________ >> R-sig-Geo mailing list >> R-sig-Geo at r-project.org >> https://stat.ethz.ch/mailman/listinfo/r-sig-geo >> > > -- > Dipl.-�k. Alexander Werner > _______________________________________________ > Universit�t Kassel > Fachbereich Wirtschaftswissenschaften > Fachgebiet Empirische Wirtschaftsforschung > Nora-Platiel-Str. 4 > 34109 Kassel > > Tel.: 0561 / 804 - 3044 > werner at wirtschaft.uni-kassel.de > http://cms.uni-kassel.de/unicms/index.php?id=31247 > _______________________________________________ > > Katie Wheeler-Martin, MPH Senior Data Analyst Department of Surgery New York University School of Medicine 550 First Avenue New York, NY 10016 Office: 1.212.263.6308 [hidden email] ------------------------------------------------------------ This email message, including any attachments, is for th...{{dropped:14}}


        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo Roger Bivand
Department of Economics
Norwegian School of Economics
Helleveien 30
N-5045 Bergen, Norway

Re: edit.nb problem with an island

Mon, 10/02/2017 - 14:49
Dear all,

I am encountering an issue related to an old thread from 2011 (pasted below), and would like to know if someone could provide sample code for when one wishes to manually delete contiguity between two points, while retaining all other contiguities for those points.

I am relatively new with R, so I apologize if this is obvious!

Thank you,

Katie



Dear Alexander,



Following your suggestion I have used this syntax and works perfectly:



x.nb[[67]] = as.integer(sort(c(43,53)))

x.nb[[43]] = as.integer(sort(c(x.nb[[43]],67)))

x.nb[[53]] = as.integer(sort(c(x.nb[[53]],67)))



Thank you very much for your help!



Marc



2011/5/17 Alexander Werner <werner at wirtschaft.uni-kassel.de<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>>:

> Dear Marc,

>

> facing a similar problem I choose to correct the NB object manually:

>

> NBDKR439[[350]]= as.integer(sort(c(NBDKR439[[350]],362)))

> NBDKR439[[362]]= as.integer(350)

>

> Hope this helps,

> Alexander

>

>

>

> Am 16.05.2011 19:01, schrieb Marc Mar� Dell'Olmo:

>>

>> Dear all,

>>

>> I have a cartography with an island, i.e. a polygon that doesn't share

>> border with other polygons (CODIGO=3120104012). I would like to

>> manually assign two areas (CODIGO=3120103024 and CODIGO=3120103014) as

>> a neighborhood areas of this island with the edit.nb function, and

>> after that to obtain the neighborhood matrix. I have followed this

>> syntax and I don't understand why the summary(x.nb2) still shows one

>> region with no link...

>>

>> If it helps, you can download the map at:

>> http://dl.dropbox.com/u/14934021/map.zip

>>

>>

>> Thank you very much,

>>

>> Marc

>>

>> map<-readShapePoly("F:/map/map.shp")

>> map<-map[order(map$CODIGO),]

>>

>>

>> x.nb<-poly2nb(map)

>> summary(x.nb)

>>

>> #Neighbour list object:

>> #Number of regions: 122

>> #Number of nonzero links: 724

>> #Percentage nonzero weights: 4.864284

>> #Average number of links: 5.934426

>> #1 region with no links:

>> #66

>> #Link number distribution:

>>

>>  #0  2  3  4  5  6  7  8  9 10 11 12 14

>>  #1  1  7 19 22 31 21 12  2  2  2  1  1

>> #1 least connected region:

>> #101 with 2 links

>> #1 most connected region:

>> #29 with 14 links

>>

>> nb<- x.nb

>> which(card(nb) == 0)

>> attr(nb, "region.id")[which(card(nb) == 0)]

>>

>>

>> x.nb2<- edit.nb(x.nb,polys=map)

>>

>> #>  x.nb2<- edit.nb(x.nb,polys=map)

>> #Identifying contiguity for deletion ...

>> #No contiguity between chosen points

>> #Add contiguity? (y/n) y

>> #added contiguity between point 53 and 67

>> #Options: quit[q] refresh[r] continue[c] c

>> #Identifying contiguity for deletion ...

>> #No contiguity between chosen points

>> #Add contiguity? (y/n) y

>> #added contiguity between point 43 and 67

>> #Options: quit[q] refresh[r] continue[c] q

>>

>>

>> summary(x.nb2)

>>

>> #Neighbour list object:

>> #Number of regions: 122

>> #Number of nonzero links: 726

>> #Percentage nonzero weights: 4.877721

>> #Average number of links: 5.95082

>> #1 region with no links:

>> #66

>> #Non-symmetric neighbours list

>> #Link number distribution:

>>

>>  #0  2  3  4  5  6  7  8  9 10 11 12 14

>>  #1  1  7 18 22 32 21 12  2  2  2  1  1

>> #1 least connected region:

>> #101 with 2 links

>> #1 most connected region:

>> #29 with 14 links

>>

>> _______________________________________________

>> R-sig-Geo mailing list

>> R-sig-Geo at r-project.org<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>

>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

>>

>

> --

> Dipl.-�k. Alexander Werner

> _______________________________________________

> Universit�t Kassel

> Fachbereich Wirtschaftswissenschaften

> Fachgebiet Empirische Wirtschaftsforschung

> Nora-Platiel-Str. 4

> 34109 Kassel

>

> Tel.: 0561 / 804 - 3044

> werner at wirtschaft.uni-kassel.de<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>

> http://cms.uni-kassel.de/unicms/index.php?id=31247

> _______________________________________________

>

>



Katie Wheeler-Martin, MPH
Senior Data Analyst
Department of Surgery
New York University School of Medicine
550 First Avenue
New York, NY 10016
Office: 1.212.263.6308
[hidden email]<mailto:[hidden email]>


------------------------------------------------------------
This email message, including any attachments, is for th...{{dropped:14}}


_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Question about the anisotropy factor in the sum metric spatiotemporalcovariance gstat

Mon, 10/02/2017 - 03:31
Dear all.
I have a question about the sum metric spatiotemporalcovariance function in
gstat. I need to understand the theoretical background and the meaning of
the anisotropy (Anis) in it.
If anyone can help me in this I will be deeply appreciated
Best regards
Sara

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: buffer from dismo package error

Sun, 10/01/2017 - 17:23
This has been cross-posted to gis.stackexchange.com if people want to
tackle it there:


https://gis.stackexchange.com/questions/257175/buffer-from-points-using-dismo-r

Barry


On Sun, Oct 1, 2017 at 10:32 PM, Sergio A Estay <[hidden email]>
wrote:

> Hi everybody,
>
> I am trying to create a buffer around several points using the function
> circles in the R package dismo. The problem arises with points that are
> close to the 180 or -180 longitude. In these cases the buffer is not a
> circle but a band that connect both sides of the map extension. Probably
> I am missing some basic option, but I am wondering if there is any way
> to avoid this issue. Below an example code and its result.
>
> library(dismo)
>
> library(rgdal)
>
> xx<-cbind(c(-175.20, -106.65,-103.97,-17.76),c(-21.13,35.08,36.78,28.65))
>
> pp<-as.data.frame(rep(1,4))
>
> zz<-SpatialPointsDataFrame(xx,pp)
>
> cc<-circles(zz,1000000,lonlat=TRUE)
>
> plot(cc)
>
>
> Thanks
>
> Sergio A Estay
>
> --
> Ejemplo 9
>
> Sergio A. Estay
> Inst. Ciencias Ambientales y Evolutivas
> Universidad Austral de Chile
> Casilla 567, Valdivia, Chile
> Phone: 5663-2293913
> Web Pages: Department <http://icaev.cl/academicos/sergio-estay/>,
> Scholar
> <http://scholar.google.cl/citations?user=94JOMYcAAAAJ&hl=en&oi=ao>,
> Researchgate
> <https://www.researchgate.net/profile/Sergio_Estay2/?ev=hdr_xprf>
>
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

buffer from dismo package error

Sun, 10/01/2017 - 16:32
Hi everybody,

I am trying to create a buffer around several points using the function
circles in the R package dismo. The problem arises with points that are
close to the 180 or -180 longitude. In these cases the buffer is not a
circle but a band that connect both sides of the map extension. Probably
I am missing some basic option, but I am wondering if there is any way
to avoid this issue. Below an example code and its result.

library(dismo)

library(rgdal)

xx<-cbind(c(-175.20, -106.65,-103.97,-17.76),c(-21.13,35.08,36.78,28.65))

pp<-as.data.frame(rep(1,4))

zz<-SpatialPointsDataFrame(xx,pp)

cc<-circles(zz,1000000,lonlat=TRUE)

plot(cc)


Thanks

Sergio A Estay

--
Ejemplo 9

Sergio A. Estay
Inst. Ciencias Ambientales y Evolutivas
Universidad Austral de Chile
Casilla 567, Valdivia, Chile
Phone: 5663-2293913
Web Pages: Department <http://icaev.cl/academicos/sergio-estay/>,
Scholar
<http://scholar.google.cl/citations?user=94JOMYcAAAAJ&hl=en&oi=ao>,
Researchgate
<https://www.researchgate.net/profile/Sergio_Estay2/?ev=hdr_xprf>


        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

commuteDistance error (gdistance)

Thu, 09/28/2017 - 11:40
Hello,

I am trying to estimate random walk resistance distances with
commuteDistance() function from the package gdistance. However, with some
of my rasters I've encountered this error:

Error in LU.dgC(a) : cs_lu(A) failed: near-singular A (or out of memory)

Sometimes it happens right away after I hit enter, in others the command
will run for along time (ca. 30 min) and hog up > 3 GB of memory, then halt
with this error. I'm wondering what may be causing the error?

I am building my transition objects with:

tr <- transition(ras, function(x) 1/mean(x), 8)

"ras" would be an irregularly shaped raster with resistance values ranging
from 1 to 10. The raster's CRS is "+proj=utm +zone=11 ellps=WGS84
+ellps=WGS84".

Any help is appreciated!

Thanks,
Santiago
--
==========================
Santiago Sanchez-Ramirez, PhD
Postdoctoral Associate
Ecology and Evolutionary Biology
University of Toronto
==========================

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Pages