Skip to content
Prev 5124 / 29559 Next

Help to improve a code to substract two columns, delete and save shape-file

Thanks for All help give me.

 

I spoke with my professor and now I must do some changes. After subtract the
column Z with clomun DEM_SGRD to obtain column H. I wish to create a new
shape with only this H column. I tried and tried but when I write the shape
file there is always an error.

Sorry for all disturb.

 

I don't want to be ill-mannered, to use improperly your time, but before to
save the shape is It possible to save only all records with H value > of 2.
(the statistical analysis need this clean)

 

Thanks

 

Ale
OGR data source with driver: ESRI Shapefile 

Source: ".", layer: "prova"

with  42  rows and  2  columns
Object of class SpatialPointsDataFrame

Coordinates:

                min       max

coords.x1  267980.1  267998.1

coords.x2 4147799.4 4147818.8

Is projected: NA 

proj4string : [NA]

Number of points: 42

Data attributes:

       Z           DEM_SGRD   

 Min.   :1415   Min.   :1412  

 1st Qu.:1419   1st Qu.:1413  

 Median :1421   Median :1414  

 Mean   :1423   Mean   :1414  

 3rd Qu.:1424   3rd Qu.:1415  

 Max.   :1437   Max.   :1417
Object of class SpatialPointsDataFrame

Coordinates:

                min       max

coords.x1  267980.1  267998.1

coords.x2 4147799.4 4147818.8

Is projected: NA 

proj4string : [NA]

Number of points: 42

Data attributes:

       Z           DEM_SGRD          H         

 Min.   :1415   Min.   :1412   Min.   : 3.169  

 1st Qu.:1419   1st Qu.:1413   1st Qu.: 5.612  

 Median :1421   Median :1414   Median : 7.320  

 Mean   :1423   Mean   :1414   Mean   : 9.265  

 3rd Qu.:1424   3rd Qu.:1415   3rd Qu.:10.982  

 Max.   :1437   Max.   :1417   Max.   :21.806
Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 

  3.169   5.612   7.320   9.265  10.980  21.810
Errore in writeOGR(prova2, ".", "prova2", driver = "ESRI Shapefile") : 

  obj of wrong class

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20090224/f52ae7bf/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prova.zip
Type: application/octet-stream
Size: 2204 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20090224/f52ae7bf/attachment.obj>