This package contains the functions I use most often working with Scottish NDR data. The functions do things such as find council names for UA codes, or calculate gross NDR bills from RVs.
You can install the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("n-fanton/ndr")
For example, the package contains a function to calculate the gross rates bill, accounting for the Intermediate and Higher property rates:
library("ndr")
## basic example code
gross_bill(rv = 100000)
#> [1] 51600
By default, the rates are set at 2021-22 levels, but can be amended if needed:
gross_bill(rv = 50000,
poundage = 0.48)
#> [1] 24000
There are also functions that convert between council names, UA codes, and VJBs:
ua_to_council(230)
#> [1] "City of Edinburgh"
council_to_ua("Na h-Eileanan Siar")
#> [1] 235
# This can also accept some misspelled or incomplete names
council_to_ua("edinburgh")
#> [1] 230
council_to_ua("eilean siar")
#> [1] 235
ua_to_vjb(300)
#> [1] "Grampian"
This table displays the functions available in the package:
| function_code | description |
|:-----------------------|:-------------------------------------------------------|
| class_code()
| Returns the class description for a code |
| council_to_ua()
| Convert council name to UA code |
| ua_to_council()
| Returns name of council for a UA code |
| ua_to_vjb()
| Returns VJB name for a UA code |
| connect_to_procxed()
| Connect to s0260a; used to get ndri and rvapp cuts |
| download_ndri_cut()
| Download pca, mye, or notified data cut |
| download_rvapp_cut()
| Download rvapp data cut |
| financial_quarter()
| Find quarter in financial year for a given month |
| financial_year()
| Find financial year for month and calendar year |
| gross_bill()
| Calculate the gross NDR bill for a RV (Scotland) |
| month_name()
| Returns the name of a month for a number 1-12 |
| month_number()
| Returns the number of a month given a name |
| %!in%
| Negates %in%
, returns TRUE if LHS is not part of RHS |
| local_authorities
| Tibble with local authorities, UA, and data zone codes |
This package is under continuous development and more functions will be added in the future!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.