HUC_aggregator: HUC Aggregator

View source: R/HUC_aggregator.R

HUC_aggregatorR Documentation

HUC Aggregator

Description

Aggregates fromHUCs recursively.

Usage

HUC_aggregator(huc, fromHUC)

Arguments

huc

The huc in question

fromHUC

The list of fromHUCs for all the hucs

Value

The list of all fromHUCs upstream of given huc

Author(s)

David Blodgett dblodgett@usgs.gov

Examples

## Not run: 
load(system.file("extdata","testhucpoly.rda",package="HUCAgg"))
hucList<-testhucPoly@data$HUC12
fromHUC<-sapply(hucList,fromHUC_finder,
                hucs=testhucPoly@data$HUC12,
                tohucs=testhucPoly@data$TOHUC)
print(unlist(fromHUC["070900020604"][[1]]))
print(c(unlist(fromHUC["070900020504"][[1]]), 
        unlist(fromHUC["070900020602"][[1]]), 
        unlist(fromHUC["070900020603"][[1]])))
aggrHUCs<-sapply(hucList, HUC_aggregator, fromHUC=fromHUC)
print(unlist(aggrHUCs["070900020604"][[1]]))

## End(Not run)


USGS-R/HUCAgg documentation built on Nov. 24, 2022, 4:36 a.m.