Title: | Download Data from the Catchment Data Explorer Website |
---|---|
Description: | Facilitates searching, download and plotting of Water Framework Directive (WFD) reporting data for all waterbodies within the UK Environment Agency area. The types of data that can be downloaded are: WFD status classification data, Reasons for Not Achieving Good (RNAG) status, objectives set for waterbodies, measures put in place to improve water quality and details of associated protected areas. The site accessed is <https://environment.data.gov.uk/catchment-planning/>. The data are made available under the Open Government Licence v3.0 <https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/>. |
Authors: | Rob Briers [aut, cre] |
Maintainer: | Rob Briers <[email protected]> |
License: | GPL-3 |
Version: | 0.4.1.9003 |
Built: | 2024-08-29 22:56:51 UTC |
Source: | https://github.com/ropensci/cde |
Facilitates searching and download of the WFD-related data for all waterbodies within the Environment Agency area (i.e. England). The types of data that can be downloaded are: WFD status classification data, Reasons for Not Achieving Good (RNAG) status, objectives set for waterbodies, and details of associated protected areas. Default plots can also be produced from thedata downloaded (form of plot depends on data type).
The website that is accessed is: https://environment.data.gov.uk/catchment-planning/. The data accessed by and included within the package are made available under the Open Government Licence v3.0 https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/
Dataframe used by 'cde' to construct API calls. The data included are made available under the Open Government Licence v3.0 https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/. Use of the data accessed by and contained within this package implies acceptance of these licence conditions.
ea_wbids
ea_wbids
A data frame with 5237 rows and 9 variables:
identifier for individual waterbodies
detailed name of the site/catchment
type of waterbody (River, Lake etc.)
Operational Catchment name
Index number of the Operational Catchment
Management Catchment name
Index number of the Management Catchment
River Basin District name
Index number of the River Basin District
For details of the hierarchy of the different catchment types, see https://environment.data.gov.uk/catchment-planning/help#help-catchment-hierarchy
https://environment.data.gov.uk/catchment-planning/
Retrieves details of objectives set for waterbodies in terms
of predicted classification from EA Catchment Data Explorer site.
Data can be retrieved by specifying waterbody id
(WBID
), Management Catchment (MC
), Operational
Catchment (OC
) or River Basin District (RBD
).
Start year (startyr
) and end year (endyr
) allow
specific timeranges to be downloaded.
For Management Catchment (MC
), Operational
Catchment (OC
) or River Basin District (RBD
) level
downloads, waterbody type
can also be specified to allow
extraction of specific waterbody types (River, Lake etc).
get_objectives( ea_name = NULL, column = NULL, level = "Overall Water Body", year = NULL, type = NULL )
get_objectives( ea_name = NULL, column = NULL, level = "Overall Water Body", year = NULL, type = NULL )
ea_name |
A string representing the description ( |
||||||||||||||||||||||||||||||||||
column |
The column to be searched. Possible options are
|
||||||||||||||||||||||||||||||||||
level |
The level within the WFD quality classification elements that objectives have been set at. For full details of the hierarchy of elements within the classification used, see https://environment.data.gov.uk/catchment-planning/help#help-classification-hierarchy. Defaults to 'Overall Water Body'. Possible values for the different levels retrieved by the function are shown below.
|
||||||||||||||||||||||||||||||||||
year |
The year that objectives are set for, either 2015, 2021, 2027, 2040 or 2050. If not given then objectives for all years are returned. Note that objectives may not be set for all years. |
||||||||||||||||||||||||||||||||||
type |
Type of waterbody to be extracted. For Operational/Management
catchment level or RBD level queries, the data can also be subset by
waterbody type. Possible values are |
An object of class cde_df
containing the details
of the objectives set for the specified set of waterbodies.
For details of the meaning of the the different columns returned,
see https://docs.ropensci.org/cde/articles/cde-output-reference.html.
# get all objectives set for waterbody GB112071065700 get_objectives(ea_name="GB112071065700", column="WBID") # get the objectives set for Lakes in the Humber RBD, for the year 2021 get_objectives(ea_name="Humber", column="RBD", year=2021, type="Lake") # get the objectives set for Rivers in the Avon Warwickshire # Management Catchment in relation to Chemical status get_objectives(ea_name="Avon Warwickshire", column="MC", level="Chemical", type="River")
# get all objectives set for waterbody GB112071065700 get_objectives(ea_name="GB112071065700", column="WBID") # get the objectives set for Lakes in the Humber RBD, for the year 2021 get_objectives(ea_name="Humber", column="RBD", year=2021, type="Lake") # get the objectives set for Rivers in the Avon Warwickshire # Management Catchment in relation to Chemical status get_objectives(ea_name="Avon Warwickshire", column="MC", level="Chemical", type="River")
Retrieves details of Protected Areas associated with
waterbodies, catchments or River Basin Districts from the EA
Catchment Data Explorer site.
Data can be retrieved by specifying waterbody id
(WBID
), Management Catchment (MC
), Operational
Catchment (OC
) or River Basin District (RBD
).
get_pa(ea_name = NULL, column = NULL)
get_pa(ea_name = NULL, column = NULL)
ea_name |
A string representing the description ( |
column |
The column to be searched. Possible options are
|
An object of class cde_df
containing the details of the
Protected Areas associated with the waterbodies.
For details of the meaning of the the different columns returned,
see https://docs.ropensci.org/cde/articles/cde-output-reference.html.
# get protected areas associated with waterbody GB112071065700 get_pa(ea_name="GB112071065700", column="WBID") # get the protected areas associated with the Humber RBD get_pa(ea_name="Humber", column="RBD") # get the protected areas associated with the Avon Warwickshire # Management Catchment get_pa(ea_name="Avon Warwickshire", column="MC")
# get protected areas associated with waterbody GB112071065700 get_pa(ea_name="GB112071065700", column="WBID") # get the protected areas associated with the Humber RBD get_pa(ea_name="Humber", column="RBD") # get the protected areas associated with the Avon Warwickshire # Management Catchment get_pa(ea_name="Avon Warwickshire", column="MC")
Retrieves details of Reasons for Not Achieving Good (RNAG)
status and Reasons For Failure (RFF) from EA Catchment Data Explorer site.
Data can be retrieved by specifying waterbody id
(WBID
), Management Catchment (MC
), Operational
Catchment (OC
) or River Basin District (RBD
).
Start year (startyr
) and end year (endyr
) allow
specific timeranges to be downloaded.
For Management Catchment (MC
), Operational
Catchment (OC
) or River Basin District (RBD
) level
downloads, waterbody type
can also be specified to allow
extraction of specific waterbody types (River, Lake etc).
Data are presented at the level of individual elements that are the
reasons for not achieving good status.
get_rnag(ea_name = NULL, column = NULL, type = NULL)
get_rnag(ea_name = NULL, column = NULL, type = NULL)
ea_name |
A string representing the description ( |
column |
The column to be searched. Possible options are
|
type |
Type of waterbody to be extracted. For Operational/Management
catchment level or RBD level queries, the data can also be subset by
waterbody type. Possible values are |
An object of class cde_df
containing the details of the
Reasons for Not Achieving Good Status for the specified combination
of criteria.
For details of the meaning of the the different columns returned,
see https://docs.ropensci.org/cde/articles/cde-output-reference.html.
# get all RNAG issues identified for waterbody GB112071065700 get_rnag("GB112071065700", "WBID") # get the RNAG issues for Lakes in the Humber RBD, between # 2013 and 2014 get_rnag(ea_name="Humber", column="RBD", type="Lake") # get the RNAG issues for Rivers in the Avon Warwickshire # Management Catchment get_rnag(ea_name="Avon Warwickshire", column="MC", type="River")
# get all RNAG issues identified for waterbody GB112071065700 get_rnag("GB112071065700", "WBID") # get the RNAG issues for Lakes in the Humber RBD, between # 2013 and 2014 get_rnag(ea_name="Humber", column="RBD", type="Lake") # get the RNAG issues for Rivers in the Avon Warwickshire # Management Catchment get_rnag(ea_name="Avon Warwickshire", column="MC", type="River")
Retrieves WFD Status classification data from EA Catchment
Data Explorer site. Data can be retrieved by specifying waterbody id
(WBID
), Management Catchment (MC
), Operational
Catchment (OC
) or River Basin District (RBD
).
Start year (startyr
) and end year (endyr
) allow
specific timeranges to be downloaded.
For Management Catchment (MC
), Operational
Catchment (OC
) or River Basin District (RBD
) level
downloads, waterbody type
can also be specified to allow
extraction of specific waterbody types (River, Lake etc).
get_status( ea_name = NULL, column = NULL, level = "Overall Water Body", startyr = NULL, endyr = NULL, type = NULL )
get_status( ea_name = NULL, column = NULL, level = "Overall Water Body", startyr = NULL, endyr = NULL, type = NULL )
ea_name |
A string representing the description ( |
||||||||||||||||||||||||||||||||||
column |
The column to be searched. Possible options are
|
||||||||||||||||||||||||||||||||||
level |
The level within the WFD quality classification elements that objectives have been set at. For full details of the hierarchy of elements within the classification used, see https://environment.data.gov.uk/catchment-planning/help/usage#catchment-hierarchy. Defaults to 'Overall Water Body'. Possible values for the different levels retrieved by the function are shown below.
|
||||||||||||||||||||||||||||||||||
startyr |
The data can be extracted for specific years using the
|
||||||||||||||||||||||||||||||||||
endyr |
The data can be extracted for specific years using the
|
||||||||||||||||||||||||||||||||||
type |
Type of waterbody to be extracted. For Operational/Management
catchment level or RBD level queries, the data can also be subset by
waterbody type. Possible values are |
An object of class cde_df
containing the classification
details for the specified combination of criteria.
For details of the meaning of the the different columns returned,
see https://docs.ropensci.org/cde/articles/cde-output-reference.html.
# get Overall Water Body status classification for waterbody GB520804714300 get_status(ea_name="GB520804714300", column="WBID") # get status class based on Priority substances for waterbody GB520804714300 get_status(ea_name="GB520804714300", column="WBID", level="Priority substances") # get the Overall Water Body status of Lakes in the Humber RBD, between # 2012 and 2014 get_status(ea_name="Humber", column="RBD", startyr=2012, endyr=2014, type="Lake") # get the Overall Water Body status for Rivers in the Avon Warwickshire # Operational Catchment in 2011 get_status(ea_name="Avon Warwickshire", column="MC", startyr=2011, type="River")
# get Overall Water Body status classification for waterbody GB520804714300 get_status(ea_name="GB520804714300", column="WBID") # get status class based on Priority substances for waterbody GB520804714300 get_status(ea_name="GB520804714300", column="WBID", level="Priority substances") # get the Overall Water Body status of Lakes in the Humber RBD, between # 2012 and 2014 get_status(ea_name="Humber", column="RBD", startyr=2012, endyr=2014, type="Lake") # get the Overall Water Body status for Rivers in the Avon Warwickshire # Operational Catchment in 2011 get_status(ea_name="Avon Warwickshire", column="MC", startyr=2011, type="River")
cde_df
outputDefault plots of the output main get_
functions.
Details of the plots for different data are given below.
For status
and objectives
produces a (stacked)
percentage barplot of waterbody observed or predicted (objective)
status information for a given set of data.
For rnag
, measures
or pa
produces a frequency
histogram. The columns plotted for each data type are given below:
rnag (pressure_tier_3)
measures (measure_category_1)
pa (protected_area_type)
The full detail of the different data being plotted can be found in the EA Catchment Data Explorer API reference: https://environment.data.gov.uk/catchment-planning/ui/reference
Plotting is only possible for MC, OC or RBD downloads.
## S3 method for class 'cde_df' plot(x, ...)
## S3 method for class 'cde_df' plot(x, ...)
x |
An object of class |
... |
Other arguments passed on to individual methods. The only other
argument implemented at present is |
Custom print
method for objects of class cde_df
.
Formats output to fit current width of console, keeping full column names
but truncating row values as required.
## S3 method for class 'cde_df' print(x, ...)
## S3 method for class 'cde_df' print(x, ...)
x |
An object of class |
... |
Other arguments passed on to individual methods. None implemented at present. |
Searches the listing of EA monitoring sites to find rows
that contain the string provided. Can search by WBID (WBID
), name
(name
), Management Catchment (MC
), Operational Catchment
(OC
) or River Basin District (RBD
). There is a hierarchical
relationship between these levels as shown at https://environment.data.gov.uk/catchment-planning/help#help-catchment-hierarchy.
The search is done on a local copy of the waterbody listing contained in
the ea_wbids
object rather than connecting to the
EA site.
search_names(string = NULL, column = NULL)
search_names(string = NULL, column = NULL)
string |
The search string to be matched (case-sensitive). Will match whole or partial strings in the column values. |
column |
The column to be searched. Possible options are
|
A data frame containing the details of all the sites that match
the search string (full or partial matches) in the column specified.
Columns returned are defined in ea_wbids
.
# search for sites containing "Tadnoll" in the name search_names(string="Tadnoll", column="name") # search for Operational Catchments containing "Cornwall" search_names(string="Cornwall", column="OC")
# search for sites containing "Tadnoll" in the name search_names(string="Tadnoll", column="name") # search for Operational Catchments containing "Cornwall" search_names(string="Cornwall", column="OC")