The US Geological Survey USGS National water Informa system

The US. Geological Survey (USGS) National water Informa system (Nwis) is that supports the acquisition, visualization, comprehensive and distributed webinterface processing, and long-term storage of w data. Summary of stream flow data each day for the period of record is provided daily data records that by represent the daily mean or other maximum, minimum, of stream flow (discharge derived values, for instance temperature Water [http://waterdata.usgs.gov/nwisswl one of the 27000 stations which has Greenville, We are intending to work with daily data record of the site number of 02162500 and is located at Saluda River nea Check the following URL and learn about its content: 65 on&form; waterdat &begin; 2011-01-01 dates 2011-12-31 00&referred; module sw. dates It is rated format of a large table including stream flow data e, maximum, minimum and mean values of stream flow (discharge) and water level stages (gage-height) along with to their recording dates. Be aware that whatever you see following after \"a\" sign are commented information that we do not need them to be imported into RStudio. Therefore, we are willing import lines starting right after the last \"H\" sign as table of data into RStudio. Following functions must be investigated and used for importing information from this and webpage as text file into Rstudio, so you must search for learing the required arguments procedures url0 read.table as one of the argument of this function If using \"read table()\" function you should use following \"NA\" for for capturing missing data records of time-series and replace empty cells with values ease up next procedures. na strings NA\") the objects that holds the data in R. Data will be imported as \"data.frame\" that is one type of modify or likewise matrix and array. Search about this types of object and see how you can work with them. Hint: sunf through following link robe cookbookldata-basicslread. ioprobe m/user-area/documentationlportfolio. a tab-separated file-into-r/ Problems to be solved:

Solution

I am assuming that file is downloaded from web and kept in the current working directory as \"data.txt\"

1. USG$_Raw_Daily_Data <- read.table( file = \"data.txt\", sep=\"\\t\", header=TRUE) #Reads a tab delimited file with header

2. USG$_Raw_Daily_Data <- UG$_Raw_Daily_Data[-1,] #Select all rows but first row

3. cols_needed <- c(\"agency_cd\",\"site_no\",\"datetime\",\"X****_00060_00003\") #List of columns needed

USG$_Mean_Daily_Discharge_Data <- USG$_Raw_Daily_Data[,cols_needed] #Select all rows and necessary columns

4. names(USG$_Mean_Daily_Discharge_Data)[4] <- \"Mean Daily Discharge (cfs)\" #Change the name of 4th column

 The US. Geological Survey (USGS) National water Informa system (Nwis) is that supports the acquisition, visualization, comprehensive and distributed webinterfa

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site