View source: R/renameColumns.R
renameNWISColumns | R Documentation |
Rename columns coming back from NWIS data retrievals. Daily and unit value columns have names derived from their data descriptor, parameter, and statistic codes. This function reads information from the header and the arguments in the call to to rename those columns.
renameNWISColumns(
rawData,
p00010 = "Wtemp",
p00045 = "Precip",
p00060 = "Flow",
p00065 = "GH",
p00095 = "SpecCond",
p00300 = "DO",
p00400 = "pH",
p62611 = "GWL",
p63680 = "Turb",
p72019 = "WLBLS",
...
)
rawData |
the daily- or unit-values datset retrieved from NWISweb. |
p00010 |
the base name for parameter code 00010. |
p00045 |
the base name for parameter code 00045. |
p00060 |
the base name for parameter code 00060. |
p00065 |
the base name for parameter code 00065. |
p00095 |
the base name for parameter code 00095. |
p00300 |
the base name for parameter code 00300. |
p00400 |
the base name for parameter code 00400. |
p62611 |
the base name for parameter code 62611. |
p63680 |
the base name for parameter code 63680. |
p72019 |
the base name for parameter code 72019. |
... |
named arguments for the base name for any other parameter code. The form of the name must be like pXXXXX, where XXXXX is the parameter code. |
A dataset like data
with selected columns renamed.
The following statistics codes are converted by renameNWISColumns
.
Instantaneous Value, suffix: Inst
Maximum value, suffix: Max
Minimum value, suffix: Min
Mean value, no suffix
Sum of values, suffix: Sum
Modal value, suffix: Mode
Median value, suffix: Median
Equivalent mean value, suffix: EqMean
Tidal high-high value, suffix: HiHiTide
Tidal low-high value, suffix: LoHiTide
Tidal high-low value, suffix: HiLoTide
Tidal low-low value, suffix: LoLoTide
readNWISdv
, readNWISuv
siteWithTwo <- "01480015"
startDate <- "2012-09-01"
endDate <- "2012-10-01"
twoResults <- readNWISdv(siteWithTwo, "00060", startDate, endDate)
names(twoResults)
renamedCols <- renameNWISColumns(twoResults)
names(renamedCols)
# Custom names:
newNames <- renameNWISColumns(twoResults, p00060 = "Discharge")
names(newNames)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.