I have a rather large dataset of watershed data stored as a
SpatialLinesDataFrame. I can plot and subset the data just fine.

In an effort to speed up plotting times I have broken up the watershed into
separate basins so that I can load and plot only those basins in my region
of interest. (This improves performance quite a lot.)

I would like to use "subWatershed = rbind(basin1,basin2,...)" to
reconstitute a single SpatialLinesDataFrame from just a few of the basins.

My problem is that the row.names in the sub-basins retain the row.names from
the original dataset:

rownames(basin1@data) = 2029:4682
rownames(basin2@data) = 1:2028

When I use rbind(basin1,basin2) I get the following error:

Error in SpatialLinesDataFrame(ll, df) :
  row.names of data and Lines IDs do not match

If I reverse the ordering and use rbind(basin2,basin1) everything is OK but
I want to do this reconstitution programmatically. I won't know ahead of
time which basins are involved or what their ordering is. In the future I
might also use basins from adjacent watersheds which have separate numbering
schemes.

Can anyone explain to me what exactly this error means and how I might
resolve it?

Thanks in advance,

Jon


-- 
Jonathan Callahan, PhD
Mazama Science
206-708-5028
mazamascience.com

	[[alternative HTML version deleted]]

