Dear Robert,
thanks for the answer, it's working perfectley!
So simple???
Cheers,

Enrico


I need
2008/11/24 Robert Hijmans <r.hijmans@gmail.com>

> Enrico,
>
> I think something like this should work for your purpose:
>
> x <- c(1,2,3,5,7,12,13)
> y <- c(1,2,9,11,7,20,10)
>
> y1 <- y[-length(y)]
> y2 <- y[-1]
> dy <- y2 - y1
> dx <- x[-1] - x[-length(x)]
> dxy <- dx * (y1 + 0.5 * dy)
> integral <- sum(dxy)
>
> Robert
>
> > Today's Topics:
> >
> >   1.  calculating integral for spectral signatures (Enrico Guastaldi)
> >   2. posting on behalf of Kevin, Yen (Roger Bivand)
> >   3. Re: WMS, WFS, WCS an WPS for R (Roger Bivand)
> >
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: Sat, 22 Nov 2008 12:59:51 +0100
> > From: "Enrico Guastaldi" <enrico.guastaldi@gmail.com>
> > Subject: [R-sig-Geo]  calculating integral for spectral signatures
> > To: r-sig-geo@stat.math.ethz.ch
> > Message-ID:
> >        <7ce8d7d30811220359n755d2e22k488ca33c10a6d509@mail.gmail.com>
> > Content-Type: text/plain
> >
> > Dear list members,
> > Does anyone know how to calculate in R integral of bivariate distribution
> of
> > discrete points suche as the following
> > x       y
> > 1       1
> > 2       2
> > 3       9
> > 5       11
> > 7       7
> > 12      20
> > 13      10
> > But I've thousands of x,y points with x always increasing: I'm talking
> about
> > spectral signature.
> > I think I need some function that "constructs" (not interpolates) a
> polyline
> > from these x,y points and then calculate the underlying area, because
> I've
> > to compare several distributions.
> >
> > Could anyone help me?
> >
> > Thanks
> >
> > --
> > Enrico Guastaldi
> > Centro di GeoTecnologie dell'Università degli Studi Siena,
> > Via Vetri Vecchi, 34
> > 52027 - San Giovanni Valdarno (AR)
> > Italy
> >
> > Tel.   +39 349 4025017
> > Fax.   +39 055 9119439
> > url:   www.geotecnologie.unisi.it
> >
> > Io uso Linux!
> > user #466775 counter.li.org
> >
> >
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > Please try to avoid to send me .dwg, .doc, .xls, .ppt files.
> > I prefer free formats.
> > http://en.wikipedia.org/wiki/Open_format
> >
> > Please consider the environment before printing this e-mail
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> >        [[alternative HTML version deleted]]
> >
> >
> >
> > ------------------------------
> >
> > Message: 2
> > Date: Sat, 22 Nov 2008 13:42:39 +0100 (CET)
> > From: Roger Bivand <Roger.Bivand@nhh.no>
> > Subject: [R-sig-Geo] posting on behalf of Kevin, Yen
> > To: r-sig-geo@stat.math.ethz.ch
> > Message-ID: <alpine.LRH.2.00.0811221337310.7189@reclus.nhh.no>
> > Content-Type: text/plain; charset="iso-8859-15"; Format="flowed"
> >
> > I'm posting this on behalf Kevin, Yen - the same text was trapped
> > yesterday as spam, so this is also a technical issue, and the reason for
> > helping in this way:
> > -----------------------
> > Hi, lists,
> >
> > I am reading meterials about GWR, but there are some problems puzzling me
> > very much:
> >
> > If there are N observations at N locations g(g1,????gn),the dependent and
> > independent variables are Y(y1,...yn) and X(x1,...xn). The formula for
> the
> > regression is Y=X*Beta, where Beta is the function of location g.
> >
> > My questions are as follows:
> >   1.How many groups should be grouped for regressing? N groups for the N
> > locations or M groups (M is a arbitrary number less than N)?
> >   2.When the parameter beta(gi) at location gi is estimated, weight Wi is
> > used. So how is W used? Are the neighboring k(with in the bandwidth h)
> > observations used for calculation?
> >   3.Beta is the function of location. Is Beta same as W or expressed as a
> > function including W like Beta=W*f(g)?
> >
> > Many thanks and best wishes
> >
> > Kevin,Yen
> > LIESMARS,Wuhan University,China
> >
> > --
> > Roger Bivand
> > Economic Geography Section, Department of Economics, Norwegian School of
> > Economics and Business Administration, Helleveien 30, N-5045 Bergen,
> > Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
> > e-mail: Roger.Bivand@nhh.no
> >
> > ------------------------------
> >
> > Message: 3
> > Date: Sat, 22 Nov 2008 14:01:16 +0100 (CET)
> > From: Roger Bivand <Roger.Bivand@nhh.no>
> > Subject: Re: [R-sig-Geo] WMS, WFS, WCS an WPS for R
> > To: Barry Rowlingson <b.rowlingson@lancaster.ac.uk>
> > Cc: r-sig-geo@stat.math.ethz.ch
> > Message-ID: <alpine.LRH.2.00.0811221357040.7189@reclus.nhh.no>
> > Content-Type: text/plain; charset="iso-8859-15"; Format="flowed"
> >
> > On Sat, 22 Nov 2008, Barry Rowlingson wrote:
> >
> >> 2008/11/22 Hisaji ONO <hi_ono2001@ybb.ne.jp>:
> >>> Hello.
> >>>
> >>>  There are lots of services of OGC(Open Geospatial
> >>> Consortium:http://www.opengeospatial.org/)'s<http://www.opengeospatial.org/%29%27s>standard
> >>> based Geo-Web ervices incluing WMS(Web Map Service),
> >>> WFS(Web Feature Service), WCS(Web Coverage Service) and
> >>> WPS(Web Processing Service) all over the world.
> >>>
> >>>  Does anyone try to use these services from R?
> >>
> >> Any access to WMS and WFS would probably be best done using GDAL and
> >> OGR via the rgdal package.... Let's see...
> >>
> >> GDAL has a WMS driver, but it seems you do have to create a 'local
> >> service description' file. www.gdal.org seems down at the moment, so
> >> here's a google cache link:
> >>
> >>
> http://216.239.59.132/search?q=cache:21OOLtr9yj0J:www.gdal.org/frmt_wms.html+gdal+wms&hl=en&ct=clnk&cd=1&gl=uk
> >>
> >> For WFS, there's some recent discussion on the gdal-dev list:
> >>
> >> http://www.nabble.com/OGR-WFS-driver-td20485363.html
> >>
> >> so it might be coming soon. Can you wait?
> >>
> >> To do WFS from scratch in R is probably going to need XML parsing,
> >> and then it'll probably also need OGR too unless you want to hand-code
> >> understanding the returned GML...
> >
> > Yes, so OGR needs to be built against the Xerces libraries. I agree that
> > WMS and WFS are best handled by using work that is already going on in
> the
> > OSGeo community. An example of R in a a WPS setting is:
> >
> > Katharina Henneb?hl, Edzer Pebesma:
> > Providing R functionality through the OGC Web Processing Service
> >
> > given at useR! 2008 in Dortmund in August - there is an abstract on the
> > conference website. I think that their trial site may be ready before
> > long, together with the underlying software.
> >
> > Roger
> >
> >>
> >> Barry
> >>
> >> _______________________________________________
> >> R-sig-Geo mailing list
> >> R-sig-Geo@stat.math.ethz.ch
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >>
> >
> > --
> > Roger Bivand
> > Economic Geography Section, Department of Economics, Norwegian School of
> > Economics and Business Administration, Helleveien 30, N-5045 Bergen,
> > Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
> > e-mail: Roger.Bivand@nhh.no
> >
> > ------------------------------
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo@stat.math.ethz.ch
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
> >
> > End of R-sig-Geo Digest, Vol 63, Issue 20
> > *****************************************
> >
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]


