Closed rburghol closed 1 year ago
Interesting ..
The StreamOrde
column is within nhd$flowline
which can be checked with
names(nhd$flowline)
[1] "id" "COMID" "fdate" "resolution" "gnis_id" "gnis_name" "LENGTHKM" "REACHCODE" "flowdir" "WBAREACOMI"
[11] "FTYPE" "FCODE" "shape_length" "streamleve" "StreamOrde" "StreamCalc" "FromNode" "ToNode" "Hydroseq" etc.
The error being returned looks like it's coming from the labeling process outlined in fn_labelprep.R
. Did the error come from the use of this function?
These are the specific lines of that function that seem to be the cause:
flow <- nhd$flowline[nhd$flowline$gnis_name!=' ' & #name!=blank & order 4, 5, or 6
(nhd$flowline$StreamOrde==6 | nhd$flowline$StreamOrde==5 | nhd$flowline$StreamOrde==4),]
## no duplicate names; prioritize higher order names and then the longest segment of each duplicate
flow <- flow[order(-flow$StreamOrde, flow$gnis_name, -flow$LENGTHKM) & !duplicated(flow$gnis_name),]
which have worked for us and is currently working for me both from the rmd and in the function itself, as long as the nhd object is created before the labeling function is called. Try regenerating the nhd
object and then executing fn_labelprep
right after
Thanks for the look @glenncampagna this is occurring when running the script via the rmarkdown command shown above.
FYI - I updated from nhdplusTools 0.6.1 to 0.6.2 and this went away.
FIXED - I updated from nhdplusTools 0.6.1 to 0.6.2 and this went away.
Run with the following (from #988):
Error:
Printing the names of the
nhd
list, I get:Fix: