[R-sig-Geo] Res: Subsetting shapefile type PolyLine

Rafael Duarte rduarte at ipimar.pt
Mon Feb 4 16:34:02 CET 2008


Obrigado Milton.

But:
teste2[teste2$ELEVATION == 100]

gives me an empty list. And I have data of Elevation = 100.

I also tried
teste2[teste2$ELEVATION >= 100]

teste2[teste2$ELEVATION == "100"]

But always an empty list and no plot.










Milton Cezar Ribeiro wrote:

> Hi Rafael
> i think that it could help you
> teste2.elev100<-teste2[teste2$ELEVATION=100]
> plot(teste2,axes=T)
> plot(teste2.elev100,col=2,add=T)
> Boa sorte.
> Miltinho
> Brazil
> ----- Mensagem original ----
> De: Rafael Duarte <rduarte at ipimar.pt>
> Para: r-sig-geo at stat.math.ethz.ch
> Enviadas: Segunda-feira, 4 de Fevereiro de 2008 8:23:08
> Assunto: [R-sig-Geo] Subsetting shapefile type PolyLine
>
> Dear all,
>
> I am very new to SIG.
> This is probably a very simple question but I could not find an answer
> searching the web and the R-SIG emails archive.
>
> I have an ESRI shapefile with a coast and bathymetric lines. In the dbf
> file I have a column “ELEVATION” that gives this information.
>
> I import the shapefile with:
>
> require(maptools)
> teste2 <- read.shape("bat_lin")
> Shapefile type: PolyLine, (3), # of Shapes: 981
>
> Now I plot this information:
> plot(teste2)
>
> But my problem is that I want to plot a subset of bathymetric lines:
> ELEVATION = 100, for example.
>
> I tried to follow the example given in maptools: subset.
> I tried to use functions: Map2lines.
> But I could not find a solution to plot only a subset of bathymetric 
> lines.
>
> Many thanks for any help.
>
> Rafael
>
>
> -- 
> Rafael Duarte
> Marine Resources Department - DRM
> IPIMAR - National Research Institute for Agriculture and Fisheries
> Av. Brasília, 1449-006 Lisbon - Portugal
> Tel:+351 21 302 7000 Fax:+351 21 301 5948
> e-mail: rduarte at ipimar.pt <mailto:rduarte at ipimar.pt>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch <mailto:R-sig-Geo at stat.math.ethz.ch>
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
> ------------------------------------------------------------------------
> Abra sua conta no Yahoo! Mail 
> <http://br.rd.yahoo.com/mail/taglines/mail/*http://br.mail.yahoo.com/>, 
> o único sem limite de espaço para armazenamento!




More information about the R-sig-Geo mailing list