ropensci/stats19

Add more documentation/advice on using the adjustment factors

Robinlovelace opened this issue · 2 comments

See #91 and #175. Could be an example with the @examples tag in the adjustments.R file would be enough but could go the whole way and produce a vignette if really keen.

Demo of using the new functionality, plan to merge this to master soon:

remotes::install_github("ropensci/stats19", ref = "adjust")
#> Using github PAT from envvar GITHUB_PAT
#> Skipping install of 'stats19' from a github remote, the SHA1 (4f7a68a4) has not changed since last install.
#>   Use `force = TRUE` to force installation
adjust = stats19::get_stats19_adjustments()
#> Unzipped files from DfT can be found in the folder:
#> ~/stats19-data/accident-and-casualty-adjusted/accident-and-casualty-adjusted
#> accident-adjustment.csv
#> adjustment-figure-guidance.docx
#> casualty-adjustment.csv
#> 
#> ── Column specification ────────────────────────────────────────────────────────
#> cols(
#>   accident_index = col_character(),
#>   adjusted_serious = col_double(),
#>   adjusted_slight = col_double(),
#>   injury_based = col_double()
#> )
head(adjust)
#> # A tibble: 6 x 4
#>   accident_index adjusted_serious adjusted_slight injury_based
#>   <chr>                     <dbl>           <dbl>        <dbl>
#> 1 2018984113018            0.0231           0.977            0
#> 2 2018984110518            0.0611           0.939            0
#> 3 2018984107318            1                0                0
#> 4 2018983113218            1                0                0
#> 5 2018983110218            1                0                0
#> 6 2018982111018            0.0514           0.949            0

Created on 2020-11-25 by the reprex package (v0.3.0)

Code to reproduce the reprex!

remotes::install_github("ropensci/stats19", ref = "adjust")
adjust = stats19::get_stats19_adjustments()
head(adjust)

reprex::reprex({
remotes::install_github("ropensci/stats19", ref = "adjust")
adjust = stats19::get_stats19_adjustments()
head(adjust)
})