R/get_consolidated_text.R
flx_get_consolidated_text.RdRetrieves the consolidated version of a statute – the text as
currently in force, with all amendments merged in – split into one
row per section (Finnish: pykala). This complements flx_get_text(),
which returns the statute's original, as-enacted text.
flx_get_consolidated_text(year, number)Integer vector. Year(s) of the statute(s) as originally enacted. The consolidated version shares the same year/number as the original statute – it is a different rendering of the same legal work, not a separate document.
Integer vector. Number(s) of the statute(s) within that
year. Recycled against year if shorter.
A tibble with one row per section (or one row with NA
section fields if the statute has no sections, has no consolidated
version, was not found, or an error occurred) and the columns:
year, number, status (one of "ok", "no_sections",
"not_found", or "error"), section_index, section_id,
heading, and text.
Not every statute has a consolidated version available – for example,
very recent statutes that have never been amended, or statutes outside
the API's consolidation coverage, will return status = "not_found".
# \donttest{
flx_get_consolidated_text(year = 1992, number = 1535) # Tuloverolaki
#> # A tibble: 249 × 7
#> year number status section_index section_id heading text
#> <int> <int> <chr> <int> <chr> <chr> <chr>
#> 1 1992 1535 ok 1 part_1__chp_1__sec_1 Tulove… "1 §…
#> 2 1992 1535 ok 2 part_1__chp_1__sec_2 Tulove… "2 §…
#> 3 1992 1535 ok 3 part_1__chp_2__sec_3v20210619 Yhteisö "3 §…
#> 4 1992 1535 ok 4 part_1__chp_2__sec_4 Yhtymä "4 §…
#> 5 1992 1535 ok 5 part_1__chp_2__sec_5 Yhteis… "5 §…
#> 6 1992 1535 ok 6 part_1__chp_2__sec_6 Kiinte… "6 §…
#> 7 1992 1535 ok 7 part_1__chp_2__sec_7 Puolis… "7 §…
#> 8 1992 1535 ok 8 part_1__chp_2__sec_8 Alaikä… "8 §…
#> 9 1992 1535 ok 9 part_1__chp_2__sec_8av200511… Euroop… "8 a…
#> 10 1992 1535 ok 10 part_1__chp_2__sec_8bv202607… Suomi "8 b…
#> # ℹ 239 more rows
# }