For a given amending or repealing statute, retrieves the statute(s) it affects (the affectedDocument references in the Akoma Ntoso document). A single amending statute can affect more than one target statute (for example, an omnibus act amending several other acts), in which case one row is returned per affected target.

flx_get_affected(year, number)

Arguments

year

Integer vector. Year(s) of the amending/repealing statute(s).

number

Integer vector. Number(s) of the statute(s) within that year. Recycled against year if shorter.

Value

A tibble::tibble() with the columns:

source_year

Year of the amending/repealing statute, as supplied.

source_number

Number of the amending/repealing statute, as supplied.

status

One of "ok" (at least one affected statute found), "no_affected" (statute found, but no affected-document references present), "not_found", or "error".

target_href

URI of the affected statute, or NA.

target_year

Year of the affected statute, or NA.

target_number

Number of the affected statute, or NA.

Details

This function does not check whether the supplied statute is actually an amendment or repeal; it simply looks for affectedDocument references in whatever statute is requested. New statutes will typically return status = "no_affected".

Examples

# \donttest{
# Look up affected statutes for a known amending statute
flx_download_statutes(
  start_year = 2023, end_year = 2023,
  categories = "amending-statute"
) |>
  head(1) |>
  with(flx_get_affected(year, number))
#> Year 2023 done (904 rows so far)
#> # A tibble: 1 × 6
#>   source_year source_number status target_href         target_year target_number
#>         <int>         <int> <chr>  <chr>                     <int>         <int>
#> 1        2023             2 ok     /akn/fi/act/statut…        2015          1352
# }