[R-sig-Geo] storing shapefiles in a function

Julius Tesoro jutesoro at yahoo.com
Tue Aug 11 06:18:42 CEST 2009


Hi 

I would like to store shapefiles in a function such that when accessing the xy coordinates or any attribute of a shapefile, you dont have to read the shapefile all over again. How do I read it once and then store it within a function?


Cheers,

Julius Tesoro

--- On Sat, 8/8/09, r-sig-geo-request at stat.math.ethz.ch <r-sig-geo-request at stat.math.ethz.ch> wrote:

> From: r-sig-geo-request at stat.math.ethz.ch <r-sig-geo-request at stat.math.ethz.ch>
> Subject: R-sig-Geo Digest, Vol 72, Issue 6
> To: r-sig-geo at stat.math.ethz.ch
> Date: Saturday, August 8, 2009, 6:00 PM
> Send R-sig-Geo mailing list
> submissions to
>     r-sig-geo at stat.math.ethz.ch
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>     https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> or, via email, send a message with subject or body 'help'
> to
>     r-sig-geo-request at stat.math.ethz.ch
> 
> You can reach the person managing the list at
>     r-sig-geo-owner at stat.math.ethz.ch
> 
> When replying, please edit your Subject line so it is more
> specific
> than "Re: Contents of R-sig-Geo digest..."
> 
> 
> Today's Topics:
> 
>    1.  inverse distance with
> covariables using gstat (Tobias Vetter)
>    2. about a variogram (Marcia Mu?oz)
>    3. Re: about a variogram (Tobias Vetter)
>    4. [Report #11] Kriging with GRASS and R:
> v.autokrige port to
>       wxPython and more (Anne Ghisla)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Fri, 07 Aug 2009 14:01:47 +0200
> From: Tobias Vetter <vetter at pik-potsdam.de>
> Subject: [R-sig-Geo]  inverse distance with
> covariables using gstat
> To: "r-sig-geo at stat.math.ethz.ch"
> <r-sig-geo at stat.math.ethz.ch>
> Message-ID: <4A7C17AB.3080104 at pik-potsdam.de>
> Content-Type: text/plain; charset=ISO-8859-15;
> format=flowed
> 
> I would like to do inverse distance interpolation with
> Trend removal.
> 
> 
> When doing:
> gstat(formula=z~Co,data=values,newdata=grid,nmax=10)
> 
>   will gstat first remove  the trend and then
> interpolate using inverse 
> distance?
> 
> Here is the output I got:
> [ordinary or weighted least squares prediction]
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Fri, 7 Aug 2009 12:37:05 -0400
> From: Marcia Mu?oz <marcarmu at gmail.com>
> Subject: [R-sig-Geo] about a variogram
> To: "r-sig-geo at stat.math.ethz.ch"
> <r-sig-geo at stat.math.ethz.ch>
> Message-ID:
>     <4d0b5e4f0908070937x389cb87cyc06092da730545a5 at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
> Dear all,
> 
> 
> 
> I want to show this variograma to you and ask about the
> meaning.  These are
> data of abundance of a tree species in the forest. I took
> the values
> (abundance = # individuals) and transformed this abundance
> with root square
> (to minimize the variance) for each point. I have 520 point
> from the forest,
> many of them with zero because the species was absent. This
> variogram means
> that there is no spatial pattern?. I fitted this variogram
> with corSphere or
> corRatio models to get these parameters, range and nugget.
> I choose a model
> with base on Akaike Information Criterion (AIC). I would
> like to use these
> values (range) for my results, but I do not known if I am
> doing right this.
> I just want to hear your opinion.
> 
> 
> 
> Thanks a lot for your help
> 
> 
> 
> Mar
> 
> 
> -- 
> Marcia C. Mu?oz
> Universidad de Puerto Rico
> Departamento de Biologia - FB246
> POBOX 23360
> San Juan, PR 00931-3360
> tel: 787-7640000, 2900
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20090807/e21be400/attachment-0001.html>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: semivariograma_adultos_ae.sqrt.jpeg
> Type: image/jpeg
> Size: 19457 bytes
> Desc: not available
> URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20090807/e21be400/attachment-0001.jpeg>
> 
> ------------------------------
> 
> Message: 3
> Date: Fri, 07 Aug 2009 18:48:53 +0200
> From: Tobias Vetter <vetter at pik-potsdam.de>
> Subject: Re: [R-sig-Geo] about a variogram
> To: Marcia Mu?oz <marcarmu at gmail.com>
> Cc: "r-sig-geo at stat.math.ethz.ch"
> <r-sig-geo at stat.math.ethz.ch>
> Message-ID: <4A7C5AF5.5000009 at pik-potsdam.de>
> Content-Type: text/plain; charset=UTF-8; format=flowed
> 
> It would be another possibilty to convert the data into
> classes.
> Simplest way:  0  if the species is missing and 1
> if existing .
> >
> > Dear all,
> >
>> >
> > I want to show this variograma to you and ask about
> the meaning.  
> > These are data of abundance of a tree species in the
> forest. I took 
> > the values (abundance = # individuals) and transformed
> this abundance 
> > with root square (to minimize the variance) for each
> point. I have 520 
> > point from the forest, many of them with zero because
> the species was 
> > absent. This variogram means that there is no spatial
> pattern?. I 
> > fitted this variogram with corSphere or corRatio
> models to get these 
> > parameters, range and nugget. I choose a model with
> base on Akaike 
> > Information Criterion (AIC). I would like to use these
> values (range) 
> > for my results, but I do not known if I am doing right
> this. I just 
> > want to hear your opinion.
> >
>> >
> > Thanks a lot for your help
> >
>> >
> > Mar
> >
> >
> >
> > -- 
> > Marcia C. Mu?oz
> > Universidad de Puerto Rico
> > Departamento de Biologia - FB246
> > POBOX 23360
> > San Juan, PR 00931-3360
> > tel: 787-7640000, 2900
> >
> >
> ------------------------------------------------------------------------
> >
> >
> ------------------------------------------------------------------------
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo at stat.math.ethz.ch
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Fri, 07 Aug 2009 20:18:40 +0200
> From: Anne Ghisla <a.ghisla at gmail.com>
> Subject: [R-sig-Geo] [Report #11] Kriging with GRASS and
> R:
>     v.autokrige port to wxPython and more
> To: OSGeo SoC <soc at lists.osgeo.org>,
> grass-dev at lists.osgeo.org,
>     r-sig-geo at stat.math.ethz.ch,
> grass-stats at lists.osgeo.org,   
> gfoss italia
>     <gfoss at faunalia.com>
> Message-ID: <4A7C7000.7040908 at gmail.com>
> Content-Type: text/plain; charset=ISO-8859-15
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello all and sorry for cross-posting,
> 
> this week I worked on error handling by GUI, adding
> controls on input
> data and parameters and hiding Run and Plot buttons unless
> all options
> are suitable.
> Variogram plotting is on its way - I discarded matplotlib
> to avoid
> further dependencies, in favour of wx.lib.plot.
> 
> best regards,
> 
> Anne
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAkp8cAAACgkQzZ3g4YwFFgb3ggCfaO4BeTfAmM4ISuh7K/j+87qq
> iqwAoJ7jaz6XMiIuZMOZnMBvfdIlt0nX
> =2VfU
> -----END PGP SIGNATURE-----
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 
> 
> End of R-sig-Geo Digest, Vol 72, Issue 6
> ****************************************
> 






More information about the R-sig-Geo mailing list