Dear List members,
I am trying to examine the fixed effects of the model (Standard error etc) for land use classes. I used geoR package for model fitting with likelihood estimation using REML. Can anyone help me with appropriate code to use for this purpose?
Thanks a lot. 

Cheers,
Sena



>________________________________
> From: "r-sig-geo-request@r-project.org" <r-sig-geo-request@r-project.org>
>To: r-sig-geo@r-project.org 
>Sent: Monday, 19 December 2011 10:00 PM
>Subject: R-sig-Geo Digest, Vol 100, Issue 18
> 
>Send R-sig-Geo mailing list submissions to
>    r-sig-geo@r-project.org
>
>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@r-project.org
>
>You can reach the person managing the list at
>    r-sig-geo-owner@r-project.org
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of R-sig-Geo digest..."
>
>
>Today's Topics:
>
>   1. Re: "Geographical CRS given to non-conformant data" for CRS
>      of epsg:4326 (Roger Bivand)
>   2. converting line segment into polyline (Miaoying Shi)
>   3. Re: converting line segment into polyline (Rolf Turner)
>   4. Distance from SpatialLinesDataFrame (Dimitrios Efthymiou)
>   5. Re: Distance from SpatialLinesDataFrame (Roger Bivand)
>   6. Re: converting line segment into polyline (Roger Bivand)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Sun, 18 Dec 2011 14:30:24 +0100 (CET)
>From: Roger Bivand <Roger.Bivand@nhh.no>
>To: Agustin.Lobo@ija.csic.es
>Cc: r-sig-geo <r-sig-geo@r-project.org>
>Subject: Re: [R-sig-Geo] "Geographical CRS given to non-conformant
>    data" for CRS of epsg:4326
>Message-ID: <alpine.LRH.2.00.1112181427380.26294@reclus.nhh.no>
>Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
>
>On Sun, 18 Dec 2011, Agustin Lobo wrote:
>
>> Yes, it does! I've tested under ubuntu 10.04. Thanks.
>
>Thanks for checking!
>
>> When is this new version of sp going to available for win and mac?
>
>We'll try to release this week.
>
>> Also, would it be possible to change the value of that point from 
>> -180.000183105 to -180.000 in R? And/or, could R print the 2 coordinates 
>> of the non-conformant points so that they can be identified in the GIS 
>> and eventually edited?
>
>The test is on the bounding box, so the value reported is the exceeding 
>value - the -180.000183105 is the value in the file at the western 
>boundary of the bounding box. This means that the exceeding coordinates 
>cannot be returned, but one could iterate over the bounding boxes of the 
>Polygons or Lines objects to find the exceeding object.
>
>Roger
>
>>
>> Agus
>>
>> 2011/12/17 Roger Bivand <Roger.Bivand@nhh.no>:
>>> On Sat, 17 Dec 2011, Roger Bivand wrote:
>>>
>>>> On Fri, 16 Dec 2011, Agustin Lobo wrote:
>>>>
>>>>> Hi!
>>>>>
>>>>> I've uploaded the file here:
>>>>> https://sites.google.com/site/filestemp2/home/world_adm0.zip
>>>>>
>>>>> It was a popular file, but actually cannot find it in the diva server any
>>>>> more
>>>>> According to qgis, there are no coordinates beyond +/- 90 or +/-180
>>>>>
>>>>> Extents:
>>>>> In layer spatial reference system units : xMin,yMin -180,-90 :
>>>>> xMax,yMax 180,83.623
>>>>> but readOGR() probably makes a more rigorous check.
>>>>
>>>>
>>>> Right. Thanks for access to the file. If I change the name of the *.prj
>>>> file, I see:
>>>>
>>>>> wrld <- readOGR(".", "world_adm0")
>>>>> print(bbox(wrld), digits=12)
>>>>
>>>> ? ? ? ? ? ?min ? ? ? ? ? ?max
>>>> x -180.000183105 180.0000000000
>>>> y ?-90.000000000 ?83.6230316162
>>>>
>>>> so it is going sufficiently far below -180 for the validity check at
>>>> .Machine$double.eps ^ 0.25 (0.0001220703), but passes with a slightly
>>>> slacker tolerance. I suggest providing a tolerance in an option in sp to
>>>> resolve this. The error is primarily to stop users assigning a +proj=longlat
>>>> to projected coordinates (yes, it does happen). I'll look to add an options
>>>> mechanism to sp to handle both error/warning and tolerance for the power to
>>>> .Machine$double.eps.
>>>
>>>
>>> This is now committed to the rspatial R-forge project, module sp, revision
>>> 1179. Now it is possible either to throw a warning rather than an error,
>>> and/or to alter the tolerance; the error message now shows the exceeding
>>> value(s):
>>>
>>>> library(rgdal)
>>>
>>> Loading required package: sp
>>> Geospatial Data Abstraction Library extensions to R successfully loaded
>>> Loaded GDAL runtime: GDAL 1.8.1, released 2011/07/09
>>> Path to GDAL shared files: /usr/local/share/gdal
>>> Loaded PROJ.4 runtime: Rel. 4.7.1, 23 September 2009, [PJ_VERSION: 470]
>>> Path to PROJ.4 shared files: (autodetected)
>>>>
>>>> wrld1 <- readOGR(".", "world_adm0")
>>>
>>> OGR data source with driver: ESRI Shapefile
>>> Source: ".", layer: "world_adm0"
>>>
>>> with 209 features and 3 fields
>>> Feature type: wkbPolygon with 2 dimensions
>>> Error in validityMethod(as(object, superClass)) :
>>> ?Geographical CRS given to non-conformant data: -180.000183105
>>>>
>>>> set_ll_warn(TRUE)
>>>
>>> [1] TRUE
>>>>
>>>> wrld1 <- readOGR(".", "world_adm0")
>>>
>>> OGR data source with driver: ESRI Shapefile
>>> Source: ".", layer: "world_adm0"
>>>
>>> with 209 features and 3 fields
>>> Feature type: wkbPolygon with 2 dimensions
>>> Warning message:
>>> In validityMethod(as(object, superClass)) :
>>> ?Geographical CRS given to non-conformant data: -180.000183105
>>>>
>>>> set_ll_warn(FALSE)
>>>
>>> [1] FALSE
>>>>
>>>> set_ll_TOL(0.2)
>>>
>>> [1] 0.2
>>>>
>>>> wrld1 <- readOGR(".", "world_adm0")
>>>
>>> OGR data source with driver: ESRI Shapefile
>>> Source: ".", layer: "world_adm0"
>>>
>>> with 209 features and 3 fields
>>> Feature type: wkbPolygon with 2 dimensions
>>>>
>>>>
>>>
>>> Please let me know if this helps,
>>>
>>> Roger
>>>
>>>
>>>>
>>>> Had you looked at using the wrld_simpl dataset that is disributed with
>>>> maptools:
>>>>
>>>> data(wrld_simpl)
>>>>
>>>> and joining countries with the codes included? It is a bit out od date in
>>>> not having the Sudan split; it is about twice the object size of the file
>>>> you are using, plotting somewhat more slowly:
>>>>
>>>>> object.size(wrld_simpl)
>>>>
>>>> 6349008 bytes
>>>>>
>>>>> object.size(wrld)
>>>>
>>>> 3250784 bytes
>>>>>
>>>>> plot(wrld_simpl)
>>>>> plot(wrld, border="red", add=TRUE)
>>>>
>>>>
>>>> The file simplifies sea ice in Antarctica, and discards many small
>>>> islands, otherwise they match pretty well.
>>>>
>>>> Roger
>>>>
>>>>>
>>>>> Could it be possible that readOGR() ?read the file with a warning
>>>>> and print the offending coordinates?
>>>>>
>>>>> readOGR() works fine with this alternative file:
>>>>> http://www.gadm.org/data/gadm_v1_lev0_shp.zip
>>>>>
>>>>> but it's huge and cannot actually work with it and have not found a
>>>>> third alternative.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Agus
>>>>>
>>>>> 2011/12/16 Roger Bivand <Roger.Bivand@nhh.no>:
>>>>>>
>>>>>> On Fri, 16 Dec 2011, Robert J. Hijmans wrote:
>>>>>>
>>>>>>> Agus,
>>>>>>>
>>>>>>> This is likely because there are some longitude coordinates that are ?<
>>>>>>> -180 or > 180.
>>>>>>> OGR does not complain, but, as these are lon/lat data, sp runs
>>>>>>> sp:::.ll_sanity ?and throws an error.
>>>>>>>
>>>>>>> I think it would be preferable if sp gave a warning rather than an
>>>>>>> error,
>>>>>>> at least when longitudes are within a reasonable number (-360 -- 360
>>>>>>> ?). I
>>>>>>> think that a longitude of, e.g. 181 is perfectly interpretable, and
>>>>>>> sometimes useful. For example to plot Russia, or Fiji in one piece in
>>>>>>> lon/lat coordinates.
>>>>>>
>>>>>>
>>>>>>
>>>>>> As Agus knows, unless the file is made available, help will likely not
>>>>>> be
>>>>>> forthcoming. Without a traceback(), we don't know where the error is
>>>>>> being
>>>>>> thrown. The fact that an out of domain number is interpretable in one
>>>>>> context doesn't necessarily make it acceptable in others, I believe. We
>>>>>> could go to an option setting, which would slacken the error to a
>>>>>> warning if
>>>>>> set. Opinions?
>>>>>>
>>>>>> Roger
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> Robert
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Dec 16, 2011 at 4:24 AM, Agustin Lobo <alobolistas@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi!
>>>>>>>> I' trying to read this shapefile that is just in lon,lat WGS84
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ogrInfo(dsn=datad,layer="world_adm0v2")
>>>>>>>>
>>>>>>>>
>>>>>>>> Source:
>>>>>>>> "/media/Iomega_HDD/JACOB/ExIE2011DATA/ExFireBorneoDATA/world_adm0",
>>>>>>>> layer: "world_adm0v2"
>>>>>>>> Driver: ESRI Shapefile number of rows 209
>>>>>>>> Feature type: wkbPolygon with 2 dimensions
>>>>>>>> +proj=longlat +datum=WGS84 +no_defs
>>>>>>>> Number of fields: 3
>>>>>>>> ? ? ?name type length typeName
>>>>>>>> 1 ? ? ?NAME ? ?4 ? ? 40 ? String
>>>>>>>> 2 GMI_CNTRY ? ?4 ? ? ?3 ? String
>>>>>>>> 3 ? ?REGION ? ?4 ? ? 25 ? String
>>>>>>>>
>>>>>>>> but I get:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> world <-readOGR(dsn=datad,layer="world_adm0v2")
>>>>>>>>
>>>>>>>>
>>>>>>>> OGR data source with driver: ESRI Shapefile
>>>>>>>> Source:
>>>>>>>> "/media/Iomega_HDD/JACOB/ExIE2011DATA/ExFireBorneoDATA/world_adm0",
>>>>>>>> layer: "world_adm0v2"
>>>>>>>> with 209 features and 3 fields
>>>>>>>> Feature type: wkbPolygon with 2 dimensions
>>>>>>>> Error in validityMethod(as(object, superClass)) :
>>>>>>>> ?Geographical CRS given to non-conformant data
>>>>>>>> I've tried
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> world
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> <-readOGR(dsn=datad,layer="world_adm0v2",p4s=CRSargs(CRS("+init=epsg:4326")))
>>>>>>>> but get the same result
>>>>>>>>
>>>>>>>> can't this CRS (epsg:4326)
>>>>>>>> +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0
>>>>>>>> be read by readOGR() ?
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Agus
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> R-sig-Geo mailing list
>>>>>>>> R-sig-Geo@r-project.org
>>>>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>>>>>>
>>>>>>>
>>>>>>> ? ? ? ?[[alternative HTML version deleted]]
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> R-sig-Geo mailing list
>>>>>>> R-sig-Geo@r-project.org
>>>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> Roger Bivand
>>>>>> Department of Economics, NHH Norwegian School of Economics,
>>>>>> 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@r-project.org
>>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> --
>>> Roger Bivand
>>> Department of Economics, NHH Norwegian School of Economics,
>>> 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@r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>
>>
>
>-- 
>Roger Bivand
>Department of Economics, NHH Norwegian School of Economics,
>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: 2
>Date: Sun, 18 Dec 2011 16:40:41 -0500
>From: Miaoying Shi <miaoyingshi23@gmail.com>
>To: r-sig-geo@r-project.org
>Subject: [R-sig-Geo] converting line segment into polyline
>Message-ID:
>    <CABx2-fDqzudn8a_6-CG8Z8GRwPT4oyzV_zpo-FWyRwQkq6A_iw@mail.gmail.com>
>Content-Type: text/plain
>
>Hello, Lists,
>
>I have been searching a method to convert psp format line segment back
>into polyline, as the psp data (p1) is like below, is there anyone can help
>me?  Thanks a lot!
>
>Erin
>
>
>
>> str(p1)
>List of 5
>$ ends      :'data.frame':     22511 obs. of  4 variables:
>  ..$ x0: num [1:22511] 233994 233966 233949 233929 233885 ...
>  ..$ y0: num [1:22511] 3355530 3355519 3355515 3355508 3355533 ...
>  ..$ x1: num [1:22511] 233946 233918 233911 233873 233889 ...
>  ..$ y1: num [1:22511] 3355510 3355511 3355512 3355513 3355514 ...
>$ window    :List of 4
>  ..$ type  : chr "rectangle"
>  ..$ xrange: Named num [1:2] 228691 236822
>  .. ..- attr(*, "names")= chr [1:2] "min" "max"
>  ..$ yrange: Named num [1:2] 3347926 3356435
>  .. ..- attr(*, "names")= chr [1:2] "min" "max"
>  ..$ units :List of 3
>  .. ..$ singular  : chr "unit"
>  .. ..$ plural    : chr "units"
>  .. ..$ multiplier: num 1
>  .. ..- attr(*, "class")= chr "units"
>  ..- attr(*, "class")= chr "owin"
>$ n         : int 22511
>$ marks     : int [1:22511] 37 37 37 37 37 37 37 37 100 100 ...
>$ markformat: chr "vector"
>- attr(*, "class")= chr [1:2] "psp" "list"
>
>    [[alternative HTML version deleted]]
>
>
>
>------------------------------
>
>Message: 3
>Date: Mon, 19 Dec 2011 20:30:58 +1300
>From: Rolf Turner <r.turner@auckland.ac.nz>
>To: Miaoying Shi <miaoyingshi23@gmail.com>
>Cc: r-sig-geo@r-project.org
>Subject: Re: [R-sig-Geo] converting line segment into polyline
>Message-ID: <4EEEE832.4010108@auckland.ac.nz>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>
>As it stands, your question does not make a lot of sense.  A psp object
>is a collection of (in general) unrelated line segments. A *polyline*
>in my understanding is a collection of *related* line segments ``joined
>end to end''.  I.e. a polyline is effectively a sequence of points (x_i,y_i)
>where (conceptually at least) the i-th point is joined to the (i+1)-st
>point by a line segment.
>
>Hence, in a sense, there is an enormous number of ways in which
>a psp object could be turned into a polyline --- arrange the segments
>in arbitrary order and then "join" the second point of the i-th segment
>to the first point of the (i+1)-st segment.  (The first point of each 
>segment
>is ``already joined'' to the second point of that segment.)
>
>Few if any of these ``ways'' would be meaningful or useful.
>
>You will have to be much more clear and explicit in your question if
>you want any real help.
>
>BTW what do you mean by ``***back*** into a polyline''?
>Please note the dictum:  "R lacks a mind_read() function."
>As do I.
>
>     cheers,
>
>         Rolf Turner
>
>P. S.  I do not know if there is formal "polyline" class (either S3 or S4)
>defined in any R package.  If there is, please enlighten me.
>
>The PBSmapping package has a class "PolySet"; a PolySet object is in
>effect a collection of polylines.
>
>         R. T.
>
>On 19/12/11 10:40, Miaoying Shi wrote:
>> Hello, Lists,
>>
>>   I have been searching a method to convert psp format line segment back
>> into polyline, as the psp data (p1) is like below, is there anyone can help
>> me?  Thanks a lot!
>>
>> Erin
>>
>>
>>
>>> str(p1)
>> List of 5
>>   $ ends      :'data.frame':     22511 obs. of  4 variables:
>>    ..$ x0: num [1:22511] 233994 233966 233949 233929 233885 ...
>>    ..$ y0: num [1:22511] 3355530 3355519 3355515 3355508 3355533 ...
>>    ..$ x1: num [1:22511] 233946 233918 233911 233873 233889 ...
>>    ..$ y1: num [1:22511] 3355510 3355511 3355512 3355513 3355514 ...
>>   $ window    :List of 4
>>    ..$ type  : chr "rectangle"
>>    ..$ xrange: Named num [1:2] 228691 236822
>>    .. ..- attr(*, "names")= chr [1:2] "min" "max"
>>    ..$ yrange: Named num [1:2] 3347926 3356435
>>    .. ..- attr(*, "names")= chr [1:2] "min" "max"
>>    ..$ units :List of 3
>>    .. ..$ singular  : chr "unit"
>>    .. ..$ plural    : chr "units"
>>    .. ..$ multiplier: num 1
>>    .. ..- attr(*, "class")= chr "units"
>>    ..- attr(*, "class")= chr "owin"
>>   $ n         : int 22511
>>   $ marks     : int [1:22511] 37 37 37 37 37 37 37 37 100 100 ...
>>   $ markformat: chr "vector"
>>   - attr(*, "class")= chr [1:2] "psp" "list"
>>
>>     [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
>
>------------------------------
>
>Message: 4
>Date: Mon, 19 Dec 2011 09:48:43 +0200
>From: Dimitrios Efthymiou <dimefthim@gmail.com>
>To: r-sig-geo@r-project.org
>Subject: [R-sig-Geo] Distance from SpatialLinesDataFrame
>Message-ID:
>    <CAFaxxcuw6GqmzLvQNJaXW9QbJTAqyPhfJxZ=WK4cvwwPnk5Z1A@mail.gmail.com>
>Content-Type: text/plain
>
>Hi,
>
>I'm using the function "distanceFromPoints" of the R package 'raster' to
>create a raster with the Euclidean distances from a SpatialPointsDataFrame.
>
>Is there a similar command to calculate the Euclidean Distance from a
>SpatialLinesDataFrame object (in my case this is a highway)?
>
>What I'm doing now, is to extract the Mid points of
>the SpatialLineDataFrame using the command "SpatialLineDataFrame", and then
>create a raster with distances from these points.
>However, I need something more accurate.
>
>Thanks in advance for you help.
>
>
>> sessionInfo() R version 2.14.0 (2011-10-31)
>Platform: x86_64-pc-linux-gnu (64-bit)
>
>locale:
>[1] C
>
>attached base packages:
>[1] splines   grid      stats     graphics  grDevices utils
>datasets  methods   base
>
>other attached packages:
>[1] ape_2.8             ade4_1.4-17         car_2.0-11
>survival_2.36-10    nnet_7.3-1
>[6] gstat_1.0-10        spacetime_0.5-7     xts_0.8-2
>zoo_1.7-6           rasterVis_0.10-7
>[11] hexbin_1.26.0       latticeExtra_0.6-19 RColorBrewer_1.0-5
>RANN_2.1.3          spdep_0.5-43
>[16] coda_0.14-6         nlme_3.1-102        MASS_7.3-16
>Matrix_1.0-2        boot_1.3-3
>[21] ggplot2_0.8.9       proto_0.3-9.2       reshape_0.8.4
>plyr_1.6            spgwr_0.6-13
>[26] spatstat_1.25-0     deldir_0.0-16       mgcv_1.7-12
>rgdal_0.7-5         maptools_0.8-10
>[31] lattice_0.20-0      foreign_0.8-48      raster_1.9-55
>sp_0.9-91
>
>loaded via a namespace (and not attached):
>[1] gee_4.13-17  tools_2.14.0
>
>
>
>-- 
>Dimitrios Efthymiou, MSc
>PhD Candidate
>National Technical University of Athens
>Laboratory of Transportation Engineering (lte.survey.ntua.gr)
>School of Rural and Surveying Engineering
>T: +30 210 7721675 - F:+30 210 7722629
>sites.google.com/site/efthymioudimitrios
>defthym@mail.ntua.gr <defthym@central.ntua.gr>
>
>
>
><http://lte.survey.ntua.gr/>
>
>    [[alternative HTML version deleted]]
>
>
>
>------------------------------
>
>Message: 5
>Date: Mon, 19 Dec 2011 09:17:11 +0100 (CET)
>From: Roger Bivand <Roger.Bivand@nhh.no>
>To: Dimitrios Efthymiou <dimefthim@gmail.com>
>Cc: r-sig-geo@r-project.org
>Subject: Re: [R-sig-Geo] Distance from SpatialLinesDataFrame
>Message-ID: <alpine.LRH.2.00.1112190916320.28929@reclus.nhh.no>
>Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
>On Mon, 19 Dec 2011, Dimitrios Efthymiou wrote:
>
>> Hi,
>>
>> I'm using the function "distanceFromPoints" of the R package 'raster' to
>> create a raster with the Euclidean distances from a SpatialPointsDataFrame.
>>
>> Is there a similar command to calculate the Euclidean Distance from a
>> SpatialLinesDataFrame object (in my case this is a highway)?
>
>Please try gDistance() in rgeos.
>
>Roger
>
>>
>> What I'm doing now, is to extract the Mid points of
>> the SpatialLineDataFrame using the command "SpatialLineDataFrame", and then
>> create a raster with distances from these points.
>> However, I need something more accurate.
>>
>> Thanks in advance for you help.
>>
>>
>>> sessionInfo() R version 2.14.0 (2011-10-31)
>> Platform: x86_64-pc-linux-gnu (64-bit)
>>
>> locale:
>> [1] C
>>
>> attached base packages:
>> [1] splines   grid      stats     graphics  grDevices utils
>> datasets  methods   base
>>
>> other attached packages:
>> [1] ape_2.8             ade4_1.4-17         car_2.0-11
>> survival_2.36-10    nnet_7.3-1
>> [6] gstat_1.0-10        spacetime_0.5-7     xts_0.8-2
>> zoo_1.7-6           rasterVis_0.10-7
>> [11] hexbin_1.26.0       latticeExtra_0.6-19 RColorBrewer_1.0-5
>> RANN_2.1.3          spdep_0.5-43
>> [16] coda_0.14-6         nlme_3.1-102        MASS_7.3-16
>> Matrix_1.0-2        boot_1.3-3
>> [21] ggplot2_0.8.9       proto_0.3-9.2       reshape_0.8.4
>> plyr_1.6            spgwr_0.6-13
>> [26] spatstat_1.25-0     deldir_0.0-16       mgcv_1.7-12
>> rgdal_0.7-5         maptools_0.8-10
>> [31] lattice_0.20-0      foreign_0.8-48      raster_1.9-55
>> sp_0.9-91
>>
>> loaded via a namespace (and not attached):
>> [1] gee_4.13-17  tools_2.14.0
>>
>>
>>
>>
>
>-- 
>Roger Bivand
>Department of Economics, NHH Norwegian School of Economics,
>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: 6
>Date: Mon, 19 Dec 2011 11:30:32 +0100 (CET)
>From: Roger Bivand <Roger.Bivand@nhh.no>
>To: Rolf Turner <r.turner@auckland.ac.nz>
>Cc: r-sig-geo@r-project.org
>Subject: Re: [R-sig-Geo] converting line segment into polyline
>Message-ID: <alpine.LRH.2.00.1112191125010.28929@reclus.nhh.no>
>Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII
>
>On Mon, 19 Dec 2011, Rolf Turner wrote:
>
>>
>> As it stands, your question does not make a lot of sense.  A psp object
>> is a collection of (in general) unrelated line segments. A *polyline*
>> in my understanding is a collection of *related* line segments ``joined
>> end to end''.  I.e. a polyline is effectively a sequence of points (x_i,y_i)
>> where (conceptually at least) the i-th point is joined to the (i+1)-st
>> point by a line segment.
>>
>> Hence, in a sense, there is an enormous number of ways in which
>> a psp object could be turned into a polyline --- arrange the segments
>> in arbitrary order and then "join" the second point of the i-th segment
>> to the first point of the (i+1)-st segment.  (The first point of each segment
>> is ``already joined'' to the second point of that segment.)
>>
>> Few if any of these ``ways'' would be meaningful or useful.
>>
>> You will have to be much more clear and explicit in your question if
>> you want any real help.
>
>Yes, it would be useful to know where the psp objects come into your 
>workflow, and if you do need them. A possible answer to your question is:
>
>library(maptools)
>xx <- readShapeSpatial(system.file("shapes/fylk-val.shp",
>  package="maptools")[1], proj4string =
>  CRS("+proj=utm +zone=33 +datum=WGS84"))
>dim(xx)
>xxPSP <- as.psp(xx[,"VALINJE_"])
>str(xxPSP)
>xx1 <- as(xxPSP, "SpatialLines")
># using the version of maptools on R-forge or wait for it to reach CRAN, 
># submitted today
>library(rgeos)
>xx2 <- gLineMerge(xx1)
>
>There isn't a way yet to merge the lines respecting the marks in the psp 
>object, but this might be possible to accommodate, xx2 here has one Lines 
>object containing 93 Line objects.
>
>Hope this helps,
>
>Roger
>
>>
>> BTW what do you mean by ``***back*** into a polyline''?
>> Please note the dictum:  "R lacks a mind_read() function."
>> As do I.
>>
>>    cheers,
>>
>>        Rolf Turner
>>
>> P. S.  I do not know if there is formal "polyline" class (either S3 or S4)
>> defined in any R package.  If there is, please enlighten me.
>>
>> The PBSmapping package has a class "PolySet"; a PolySet object is in
>> effect a collection of polylines.
>>
>>        R. T.
>>
>> On 19/12/11 10:40, Miaoying Shi wrote:
>>> Hello, Lists,
>>>
>>>   I have been searching a method to convert psp format line segment back
>>> into polyline, as the psp data (p1) is like below, is there anyone can help
>>> me?  Thanks a lot!
>>> 
>>> Erin
>>> 
>>> 
>>> 
>>>> str(p1)
>>> List of 5
>>>   $ ends      :'data.frame':     22511 obs. of  4 variables:
>>>    ..$ x0: num [1:22511] 233994 233966 233949 233929 233885 ...
>>>    ..$ y0: num [1:22511] 3355530 3355519 3355515 3355508 3355533 ...
>>>    ..$ x1: num [1:22511] 233946 233918 233911 233873 233889 ...
>>>    ..$ y1: num [1:22511] 3355510 3355511 3355512 3355513 3355514 ...
>>>   $ window    :List of 4
>>>    ..$ type  : chr "rectangle"
>>>    ..$ xrange: Named num [1:2] 228691 236822
>>>    .. ..- attr(*, "names")= chr [1:2] "min" "max"
>>>    ..$ yrange: Named num [1:2] 3347926 3356435
>>>    .. ..- attr(*, "names")= chr [1:2] "min" "max"
>>>    ..$ units :List of 3
>>>    .. ..$ singular  : chr "unit"
>>>    .. ..$ plural    : chr "units"
>>>    .. ..$ multiplier: num 1
>>>    .. ..- attr(*, "class")= chr "units"
>>>    ..- attr(*, "class")= chr "owin"
>>>   $ n         : int 22511
>>>   $ marks     : int [1:22511] 37 37 37 37 37 37 37 37 100 100 ...
>>>   $ markformat: chr "vector"
>>>   - attr(*, "class")= chr [1:2] "psp" "list"
>>>
>>>     [[alternative HTML version deleted]]
>>> 
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo@r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>-- 
>Roger Bivand
>Department of Economics, NHH Norwegian School of Economics,
>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@r-project.org
>https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
>End of R-sig-Geo Digest, Vol 100, Issue 18
>******************************************
>
>
>
	[[alternative HTML version deleted]]

