header_tag.html

Skip to contents

Uses attributes from the NWIS functions to create data citations.

Usage

create_NWIS_bib(x)

Arguments

x

Any data returned from an NWIS function, must include "queryTime" and "url" attributes, which should come with the data by default.

Value

bibentry object to use for citing the data.

Details

See ?bibentry for more information.

Examples

# \donttest{
nwisData <- readNWISdv("04085427", "00060", "2012-01-01", "2012-06-30")
#> Warning: NWIS servers are slated for decommission. Please begin to migrate to read_waterdata_daily.
#> GET: https://waterservices.usgs.gov/nwis/dv/?site=04085427&format=waterml%2C1.1&ParameterCd=00060&StatCd=00003&startDT=2012-01-01&endDT=2012-06-30
nwis_citation <- create_NWIS_bib(nwisData)
nwis_citation
#> U.S. Geological Survey (2025). _National Water Information System data
#> available on the World Wide Web (USGS Water Data for the Nation)_.
#> doi:10.5066/F7P55KJN <https://doi.org/10.5066/F7P55KJN>, Accessed Jun
#> 27, 2025,
#> <https://waterservices.usgs.gov/nwis/dv/?site=04085427&format=waterml%2C1.1&ParameterCd=00060&StatCd=00003&startDT=2012-01-01&endDT=2012-06-30>.

print(nwis_citation, style = "Bibtex")
#> @Manual{,
#>   title = {National Water Information System data available on the World Wide Web (USGS Water Data for the Nation)},
#>   author = {{U.S. Geological Survey}},
#>   doi = {10.5066/F7P55KJN},
#>   note = {Accessed Jun 27, 2025},
#>   year = {2025},
#>   url = {https://waterservices.usgs.gov/nwis/dv/?site=04085427&format=waterml%2C1.1&ParameterCd=00060&StatCd=00003&startDT=2012-01-01&endDT=2012-06-30},
#> }
print(nwis_citation, style = "citation")
#> U.S. Geological Survey, 2025, National Water Information System data
#> available on the World Wide Web (USGS Water Data for the Nation),
#> accessed Jun 27, 2025, at
#> https://waterservices.usgs.gov/nwis/dv/?site=04085427&format=waterml%2C1.1&ParameterCd=00060&StatCd=00003&startDT=2012-01-01&endDT=2012-06-30,
#> https://dx.doi.org/10.5066/F7P55KJN
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Manual{,
#>     title = {National Water Information System data available on the World Wide Web (USGS Water Data for the Nation)},
#>     author = {{U.S. Geological Survey}},
#>     doi = {10.5066/F7P55KJN},
#>     note = {Accessed Jun 27, 2025},
#>     year = {2025},
#>     url = {https://waterservices.usgs.gov/nwis/dv/?site=04085427&format=waterml%2C1.1&ParameterCd=00060&StatCd=00003&startDT=2012-01-01&endDT=2012-06-30},
#>   }
# }