this function takes any NHDPlus dataset and aligns the attribute names with those used in nhdplusTools.

align_nhdplus_names(x)

Arguments

x

a sf object of nhdplus flowlines

Value

data.frame renamed sf object

Examples

source(system.file("extdata/new_hope_data.R", package = "nhdplusTools"))

names(new_hope_flowline)
#>   [1] "COMID"      "FDATE"      "RESOLUTION" "GNIS_ID"    "GNIS_NAME" 
#>   [6] "LENGTHKM"   "REACHCODE"  "FLOWDIR"    "WBAREACOMI" "FTYPE"     
#>  [11] "FCODE"      "StreamLeve" "StreamOrde" "StreamCalc" "FromNode"  
#>  [16] "ToNode"     "Hydroseq"   "LevelPathI" "Pathlength" "TerminalPa"
#>  [21] "ArbolateSu" "Divergence" "StartFlag"  "TerminalFl" "DnLevel"   
#>  [26] "UpLevelPat" "UpHydroseq" "DnLevelPat" "DnMinorHyd" "DnDrainCou"
#>  [31] "DnHydroseq" "FromMeas"   "ToMeas"     "RtnDiv"     "VPUIn"     
#>  [36] "VPUOut"     "AreaSqKM"   "TotDASqKM"  "DivDASqKM"  "Tidal"     
#>  [41] "TOTMA"      "WBAreaType" "HWNodeSqKM" "MAXELEVRAW" "MINELEVRAW"
#>  [46] "MAXELEVSMO" "MINELEVSMO" "SLOPE"      "ELEVFIXED"  "HWTYPE"    
#>  [51] "SLOPELENKM" "QA_MA"      "VA_MA"      "QC_MA"      "VC_MA"     
#>  [56] "QE_MA"      "VE_MA"      "QA_01"      "VA_01"      "QC_01"     
#>  [61] "VC_01"      "QE_01"      "VE_01"      "QA_02"      "VA_02"     
#>  [66] "QC_02"      "VC_02"      "QE_02"      "VE_02"      "QA_03"     
#>  [71] "VA_03"      "QC_03"      "VC_03"      "QE_03"      "VE_03"     
#>  [76] "QA_04"      "VA_04"      "QC_04"      "VC_04"      "QE_04"     
#>  [81] "VE_04"      "QA_05"      "VA_05"      "QC_05"      "VC_05"     
#>  [86] "QE_05"      "VE_05"      "QA_06"      "VA_06"      "QC_06"     
#>  [91] "VC_06"      "QE_06"      "VE_06"      "QA_07"      "VA_07"     
#>  [96] "QC_07"      "VC_07"      "QE_07"      "VE_07"      "QA_08"     
#> [101] "VA_08"      "QC_08"      "VC_08"      "QE_08"      "VE_08"     
#> [106] "QA_09"      "VA_09"      "QC_09"      "VC_09"      "QE_09"     
#> [111] "VE_09"      "QA_10"      "VA_10"      "QC_10"      "VC_10"     
#> [116] "QE_10"      "VE_10"      "QA_11"      "VA_11"      "QC_11"     
#> [121] "VC_11"      "QE_11"      "VE_11"      "QA_12"      "VA_12"     
#> [126] "QC_12"      "VC_12"      "QE_12"      "VE_12"      "LakeFract" 
#> [131] "SurfArea"   "RAreaHLoad" "RPUID"      "VPUID"      "Enabled"   
#> [136] "geom"      

names(new_hope_flowline) <- tolower(names(new_hope_flowline))

new_hope_flowline <- align_nhdplus_names(new_hope_flowline)

names(new_hope_flowline)
#>   [1] "COMID"      "fdate"      "resolution" "gnis_id"    "gnis_name" 
#>   [6] "LENGTHKM"   "REACHCODE"  "flowdir"    "WBAREACOMI" "FTYPE"     
#>  [11] "FCODE"      "streamleve" "StreamOrde" "StreamCalc" "FromNode"  
#>  [16] "ToNode"     "Hydroseq"   "LevelPathI" "Pathlength" "TerminalPa"
#>  [21] "ArbolateSu" "Divergence" "StartFlag"  "TerminalFl" "DnLevel"   
#>  [26] "UpLevelPat" "UpHydroseq" "DnLevelPat" "DnMinorHyd" "dndraincou"
#>  [31] "DnHydroseq" "FromMeas"   "ToMeas"     "rtndiv"     "vpuin"     
#>  [36] "vpuout"     "AreaSqKM"   "TotDASqKM"  "divdasqkm"  "tidal"     
#>  [41] "totma"      "wbareatype" "hwnodesqkm" "maxelevraw" "minelevraw"
#>  [46] "maxelevsmo" "minelevsmo" "slope"      "elevfixed"  "hwtype"    
#>  [51] "slopelenkm" "qa_ma"      "va_ma"      "qc_ma"      "vc_ma"     
#>  [56] "qe_ma"      "ve_ma"      "qa_01"      "va_01"      "qc_01"     
#>  [61] "vc_01"      "qe_01"      "ve_01"      "qa_02"      "va_02"     
#>  [66] "qc_02"      "vc_02"      "qe_02"      "ve_02"      "qa_03"     
#>  [71] "va_03"      "qc_03"      "vc_03"      "qe_03"      "ve_03"     
#>  [76] "qa_04"      "va_04"      "qc_04"      "vc_04"      "qe_04"     
#>  [81] "ve_04"      "qa_05"      "va_05"      "qc_05"      "vc_05"     
#>  [86] "qe_05"      "ve_05"      "qa_06"      "va_06"      "qc_06"     
#>  [91] "vc_06"      "qe_06"      "ve_06"      "qa_07"      "va_07"     
#>  [96] "qc_07"      "vc_07"      "qe_07"      "ve_07"      "qa_08"     
#> [101] "va_08"      "qc_08"      "vc_08"      "qe_08"      "ve_08"     
#> [106] "qa_09"      "va_09"      "qc_09"      "vc_09"      "qe_09"     
#> [111] "ve_09"      "qa_10"      "va_10"      "qc_10"      "vc_10"     
#> [116] "qe_10"      "ve_10"      "qa_11"      "va_11"      "qc_11"     
#> [121] "vc_11"      "qe_11"      "ve_11"      "qa_12"      "va_12"     
#> [126] "qc_12"      "vc_12"      "qe_12"      "ve_12"      "lakefract" 
#> [131] "surfarea"   "rareahload" "RPUID"      "VPUID"      "enabled"   
#> [136] "geom"