R: Packages and Data Retrieval

Slides:



Advertisements
Similar presentations
HydroServer A Platform for Publishing Space- Time Hydrologic Datasets Support EAR CUAHSI HIS Sharing hydrologic data Jeffery.
Advertisements

Linking HIS and GIS How to support the objective, transparent and robust calculation and publication of SWSI? Jeffery S. Horsburgh CUAHSI HIS Sharing hydrologic.
Components of an Integrated Environmental Observatory Information System Cyberinfrastructure to Support Publication of Water Resources Data Jeffery S.
Time Series Analyst An Internet Based Application for Viewing and Analyzing Environmental Time Series Jeffery S. Horsburgh Utah State University David.
Integrating Historical and Realtime Monitoring Data into an Internet Based Watershed Information System for the Bear River Basin Jeff Horsburgh David Stevens,
Introducing the CUAHSI Hydrologic Information System Desktop Application (HydroDesktop) and Open Development Community Jiří Kadlec, Daniel Ames, Teva Velupillai.
Using HydroServer Organize, Manage, and Publish Your Data Support EAR CUAHSI HIS Sharing hydrologic data Jeffery S. Horsburgh.
U.S. Department of the Interior U.S. Geological Survey NWIS Web Services Snapshot for ArcGIS Sally Holl and David Maltby Based on work by David McCulloch.
A tour of new features introducing LINQ. Agenda of LINQ Presentation We have features for every step of the way LINQ Fundamentals Anonymous Functions/Lambda.
XP New Perspectives on Microsoft Access 2002 Tutorial 71 Microsoft Access 2002 Tutorial 7 – Integrating Access With the Web and With Other Programs.
Ocean Sciences What is CUAHSI? CUAHSI – Consortium of Universities for the Advancement of Hydrologic Science, Inc Formed in 2001 as a legal entity Program.
Exercises: Organizing, Loading, and Managing Point Observations Using HydroServer Support EAR CUAHSI HIS Sharing hydrologic data
Publishing Observations Data: from ODM to HIS Central.
What is CUAHSI? Source:
Water Quality Data, Maps, and Graphs Over the Web · Chemical concentrations in water, sediment, and aquatic organism tissues.
PowerBuilder Online Courses - by Prasad Bodepudi
Water and Catchment Data Services David R. Maidment Center for Research in Water Resources University of Texas at Austin River Science Symposium Swansea,
CERN - IT Department CH-1211 Genève 23 Switzerland t DB Development Tools Benthic SQL Developer Application Express WLCG Service Reliability.
Agency for Healthcare Research and Quality Advancing Excellence in Health Care A Web-Based Tool for Quality and Utilization Reporting Anne.
3-Tier Client/Server Internet Example. TIER 1 - User interface and navigation Labeled Tier 1 in the following graphic, this layer comprises the entire.
Agency for Healthcare Research and Quality Advancing Excellence in Health Care A Web-Based Tool for Quality and.
September 2012 Developed by Agricultural and Biological Engineering Department at Purdue University and Department of Regional Infrastructures Engineering.
Agency for Healthcare Research and Quality Advancing Excellence in Health Care A Web-Based Tool for Quality and Utilization Reporting Visit.
The CUAHSI Observations Data Model Jeff Horsburgh David Maidment, David Tarboton, Ilya Zaslavsky, Michael Piasecki, Jon Goodall, David Valentine,
Data Model / Database Implementation (continued) Jeffery S. Horsburgh Hydroinformatics Fall 2014 This work was funded by National Science Foundation Grants.
U.S. Department of the Interior U.S. Geological Survey Water Data Sharing Using OGC Standards and the Internet David Blodgett USGS Center for Integrated.
HydroGET A web service client for ArcGIS Ernest To PhD Candidate, University of Texas at Austin August 2008.
Lecture 11 Introduction to R and Accessing USGS Data from Web Services Jeffery S. Horsburgh Hydroinformatics Fall 2013 This work was funded by National.
Data Management: Data Processing Types of Data Processing at USGS There are several ways to classify Data Processing activities at USGS, and here are some.
Hydroinformatics Lecture 15: HydroServer and HydroServer Lite The CUAHSI HIS is Supported by NSF Grant# EAR CUAHSI HIS Sharing hydrologic data.
The Bear River Watershed Information System Jeffery S. Horsburgh Utah Water Research Laboratory Utah State University David.
UNIVERSITY OF UTAH GREEN INFRASTRUCTURE MONITORING DATABASE CVEEN 7970 Hydroinformatics Semester Project Zachary Magdol, Jai Kanth Panthail, Pratibha Sapkota,
Using Python to Retrieve Data from the CUAHSI HIS Web Services Jeffery S. Horsburgh Hydroinformatics Fall 2015 This work was funded by National Science.
IR Homework #2 By J. H. Wang May 9, Programming Exercise #2: Text Classification Goal: to classify each document into predefined categories Input:
Desktop Database and Climate Analysis Steven Burian and Erfan Goharian Hydroinformatics Fall 2013.
Using Python to Retrieve Data from the CUAHSI HIS Web Services Jon Goodall Hydroinformatics Fall 2014 This work was funded by National Science Foundation.
Jeffery S. Horsburgh Hydroinformatics Fall 2014
Intermountain West Data Warehouse - Western Air Quality Study
The CUAHSI Hydrologic Information System Spatial Data Publication Platform David Tarboton, Jeff Horsburgh, David Maidment, Dan Ames, Jon Goodall, Richard.
Architecture Review 10/11/2004
Using GIS in Creating an End-to-End System for Publishing Environmental Observations Data Jeffery S. Horsburgh David G. Tarboton, David R. Maidment, Ilya.
Excel Lesson 8 Working with Charts
R: Working with Databases
Developer 2000 CSE 4504/6504 Lab.
Project Center Use Cases Revision 2
Project Center Use Cases
Segments Basic Uses: slides minutes
R: Packages and Data Retrieval
The Use of AMET and Automated Scripts for Model Evaluation
Introduction to Visual Basic 2008 Programming
Getting Started with R.
Project Center Use Cases
Lecture 8 Database Implementation
Attie Bioinformatics Server Redesign
CUAHSI HIS Sharing hydrologic data
Client / Server Application Presentation
Project Center Use Cases Revision 3
Project Center Use Cases Revision 3
HydroDesktop: A Key Component of the CUAHSI/CZO HIS for Hydrologic Data Discovery, Visualization, and Analysis Daniel P. Ames, Ph.D. P.E. Idaho State University.
Tutorial 8 Objectives Continue presenting methods to import data into Access, export data from Access, link applications with data stored in Access, and.
homework assignment due Feb 23
Databases, Web Pages and Archives
Creating Database Reports
Chapter 10 ADO.
Tutorial 7 – Integrating Access With the Web and With Other Programs
Databases Continued 10/18/05.
Recitation on AdFisher
Excel Lesson 8 Working with Charts
Web Application Development Using PHP
ESRI User Conference Water Resources User Group, July 15, 2010
Presentation transcript:

R: Packages and Data Retrieval Hydroinformatics – Fall 2016

Learning Objectives Describe the difference between packages and libraries in R Install and load packages Use documentation and other resources to learn how to use unfamiliar packages Use data retrieval packages and web services to obtain hydrologic data Use packages to interact with databases

R Packages and Libraries Package: R functions, data, and compiled code in a well- defined format. Library: The directory where packages are stored.  Implement many common data analysis and statistical procedures Provide excellent graphics functionality Serve as a starting point for many data analysis tasks A huge community of R developers exist – it’s likely that there’s an R package for many of the tasks you commonly do

Installing and loading Packages library() #displays available packages Tools>Install Packages or install.packages(“package_name”) library(package_name) #loads package

USGS Data Retrieval Package for R Collection of functions to help retrieve hydrologic and water quality data using web services: U.S. Geological Survey (USGS) using National Water Information System (NWIS) tools U.S. Environmental Protection Agency (EPA) Data access is through web services Try installing and loading the dataRetrieval package

Demo – dataRetrieval We want to automate the retrieval and import of data from a specific site into R using the dataRetrieval package. But how? https://github.com/USGS-R/dataRetrieval Use the source, Luke!

Demo – dataRetrieval for Gage Height Try: Retrieve USGS gage height data (parameter code: 00065) for the site “10171000” for May 2014 using the readNWISdata function. This package is well documented and its examples are very useful for modifying/tailoring to specific needs. For example, this code uses “service” (look at the examples and see that it is “iv” for one readNWISdata() and it is “site” for another. What do these terms mean, and where can you find out about them?

instGage <- readNWISdata(sites="10171000", service="iv",parameterCd="00065", startDate='2014-05-01T00:00Z',endDate='2014-05-31T00:00Z')

WaterML Package for R WaterML is a standard information model for the representation of water observations data, with the intent of allowing the exchange of such data sets across information systems. retrieve and analyze data from HydroServers of multiple organizations that are listed in the CUAHSI Water Data Center catalog  great example of semester project

Demo - WaterML In partners, follow the tutorial to retrieve data and fit a linear model between two parameters (dissolved oxygen and temperature) https://www.cuahsi.org/Files/Posts/documents/WDC_Handout. pdf Post your team’s results after step 6 to the google doc: https://goo.gl/Fy0Zjc *make sure to specify the column (Temp$DataValue) *label the axes, and use different colors or markers *put your team member’s names by your plot

RMySQL Package https://github.com/rstats-db/rmysql

RMySQL Package Note: You need to actually set the password! dbDriver tells it which type of Database management system you are working with

Interacting with Your Database Try: Listing all available tables in the database Hint 1: Look up functions ls("package:RMySQL") Hint 2: Use help(“function_name”) to get arguments This code was modified from the sql script that we used to create the tables in the LoganRiverODM database.

Interacting with Your Database What does the argument “n=-1” mean? No need to parse the data – the Fetch function puts the queried data directly into an R data.frame format! Note: What is the n=-1? (Look at the help(dbFetch) for more information on the syntax) No need to parse data – it automatically assigns column names

Homework: Use one of the data retrieval packages to obtain a time-series of streamflow data (any parameter that you are interested in) from any site in Utah, and then use the RMySQL package to obtain a time-series of the same parameter for a different site from your LoganRiverODM database. Create a plot and do some basic comparisons/statistical summaries of the datasets. How does the documentation style of RMySQL compare to the USGS dataRetrieval Package? to the WaterML package? What is most useful? What is the most confusing thing about using a new package? How does the creator of a package communicate most effectively with new users? What other tools do you have (besides the GitHub page) to help you learn how to use a package?