Dear Helper,

I have a spatial lines data frame object 'spRiverDf'. The data frame consists 
of numbers {0,1,...,5}. And I have a vector 'colorS' of length 6 with different 
colours.

If I make a plot with spplot I get a plot of the lines - colours depending on 
there number in the data frame column:

spplot(spRiverDf['data.col.1'], zcol=..., names.attr=..., col.regions=colorS, 
lwd=10) # (A)

My problem:
- I'd like to overlay narrow lines (lwd=5) with the appropriate colors of a 
second data column.

My tests:
1) I tried it with the spplot options: lwd=10, 
sp.layout=list(list(spRiverDf['data.col.2'], col=colorS, lwd=5))
2) Second try: result <- spplot("entries_see_(A)"); result + 
layer(sp.lines(spRiverDf['data.col.2'], col=colorS, lwd=5))

My results:
- In both tests I get with spplot the desired but with the additional things 
only single-coloured (takes the first entry of 'colorS') lines.

My questions:
- Is there a possebility to overlay two spplots? Something like option add=TRUE 
for the usual 'plot' command.
- Or is there an easy way to select desired lines of a spatial plot data frame 
(e.g. with a special colour) that I can use 'sp.layout' or 'layer'?
- Of course I can create for additional data frame columns own spatial lines 
data frames for each color (depending on the number entry in the column) but 
this is very time-consuming - and realy not elegant.

Thank you for your help!
Thomas
--

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to