install.packages("hydroMaps",
repos = c("http://owi.usgs.gov/R", "http://cran.us.r-project.org"))
hydroMaps
depends on the R packages sp
,rgeos
, and rgdal
all of which require an external library gdal to be installed. See :
https://www.mapbox.com/tilemill/docs/guides/gdal/
install.packages("hydroMaps",
repos = c("http://owi.usgs.gov/R", "http://cran.us.r-project.org"))
library(dataRetrieval)
library(hydroMap)
sites <- c("01491000", "01573000", "01576000")
siteInfo <- readNWISsite(sites)
# png("test.png",width=11,height=8,units="in",res=600,pointsize=4)
plotWSB(sites)
## OGR data source with driver: ESRI Shapefile
## Source: "C:\Users\ldecicco\AppData\Local\Temp\1\RtmpCONae8", layer: "epa_basins"
## with 3 features
## It has 4 fields
# dev.off()
plotWSB(sites)
## OGR data source with driver: ESRI Shapefile
## Source: "C:\Users\ldecicco\AppData\Local\Temp\1\RtmpCONae8", layer: "epa_basins"
## with 3 features
## It has 4 fields
points(siteInfo$dec_long_va, siteInfo$dec_lat_va, pch=20, col="red", cex=2)
axis(2,las=1)
axis(1,las=1)
title(paste("Sites:",paste0(siteInfo$site_no,collapse = ",")))
library(leaflet)
basins <- getBasin(sites)
leaflet() %>%
addProviderTiles("CartoDB.Positron") %>%
setView(-75.8, 40, zoom = 6) %>%
addPolygons(data=basins, weight=2) %>%
addCircleMarkers(siteInfo$dec_long_va,siteInfo$dec_lat_va,
color = "red",
radius=3,
stroke=FALSE,
fillOpacity = 0.8, opacity = 0.8,
popup=siteInfo$station_nm)
In order to contribute to this code, we recommend the following workflow:
-
"fork" this repository to your own personal github account
-
clone the github repository to your computer:
$git clone https://github.com/{username}/hydroMaps.git
-
modify code or add new functionality, save the code
-
add the repository master to a remote master called "upstream"
$cd hydroMaps
$git remote add upstream https://github.com/USGS-R/hydroMaps.git
-
before pushing your changes to your repository, pull in the current version of the USGS-R master:
$git fetch upstream
-
merge these differences with your own "master" version:
$git merge upstream/master
-
push your changes to your github repository, in addition to changes made by pulling in the GLEON master:
$git push
-
submit a pull request to USGS-R master using your account at github.com
This software is in the public domain because it contains materials that originally came from the U.S. Geological Survey, an agency of the United States Department of Interior. For more information, see the official USGS copyright policy
Although this software program has been used by the U.S. Geological Survey (USGS), no warranty, expressed or implied, is made by the USGS or the U.S. Government as to the accuracy and functioning of the program and related program material nor shall the fact of distribution constitute any such warranty, and no responsibility is assumed by the USGS in connection therewith.
This software is provided "AS IS."