Read .rpt file

Share:

Description

reads an Epanet .rpt file into R

Usage

1

Arguments

file

the name of the file to read

Details

add lines "Page 0", "Links All" and "Nodes All" to the [REPORT] section of the .inp file to output info to read in with this function

In contrast to the treatment of .inp files, data from .rpt files is stored using a slightly different structure than the .rpt file. The function returns an object (list) with a data.frame for node results and data.frame for link results. These two data frames contain results from all the time periods to facilitate time series plots.

Value

Returns an epanet.rpt S3 object with two data.frame elements.

nodeResults

data.frame

linkResults

data.frame

References

Rossman, L. A. (2000). Epanet 2 users manual. US EPA, Cincinnati, Ohio.

http://nepis.epa.gov/Adobe/PDF/P1007WWU.pdf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# path to Net1.rpt example file included with this package
rpt <- file.path( find.package("epanetReader"), "extdata","Net1.rpt") 
n1r <- read.rpt(rpt)
summary(n1r)
names(n1r)


#Results for a chosen time period can be retrieved using the subset function.
subset(n1r$nodeResults, Timestamp == "0:00:00")

# time series plot for a nodal value
plot( Chlorine ~ timeInSeconds,  
      data = subset(n1r$nodeResults, ID == "22"))    

# Plotting the epanet.rpt object itself gives a map.
# Note that the object created from the .inp file is required.
inp <- file.path( find.package("epanetReader"), "extdata","Net1.inp") 
n1 <- read.inp(inp)
plot( n1r, n1)