Description Usage Arguments Details
Given a data frame or a vector containing standardised names or codes of UK statistical geographies, return a data frame with a column for each geography that the input geographies are contained within.
1 2 3 4 5 6 7 | gss_lookup(
data,
col_gss = "gss_code",
col_return = NULL,
vintage = NULL,
limit = NULL
)
|
data |
A data frame containing a column with gss data, or a vector of gss codes or names. |
col_gss |
If |
col_return |
Names of resolutions to return. Can be names (e.g. LSOA),
gss prefixes (e.g. E01), and optionally can have 2-digit vintage year
and/or 'NM' or 'CD' suffixes, e.g. LSOA, LSOA11, LSOA11NM, E01, E0111,
E0111CD. If no CD/NM suffix is specified, both will be returned, The
vintage must be consistent with |
vintage |
A date that the returned GSS codes should be valid for. The
default, NULL, is interpreted as the most recent data available. A year
(string or integer) gives the 31st December of that year, which is the
usual way of dating ONS geographic vintages. A month or date, formatted
"
is excluded). Also accepts Date objects. Returned column names will include
the year of the vintage when the vintage provided was for December 31st, or
a date was not specified within the year (e.g. LSOA11CD), otherwise it will
be undated (e.g. LSOACD), unless |
limit |
Integer. The maximum number of rows to return. NULL is unlimited. |
Currently only works for official parent geographies, so e.g. 2011 LSOAs are not contained within 2011 wards.
Note that calls to the ONS Open Geography API limit response size to 10 MB.
If you're looking for the GSS hierarchy for the whole of the UK, you can use
the function with the same name in the geogr.uk
package where data are
downloaded with the package and stored locally, or get it manually from
<TODO: URL>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.