Skip to content

Commit

Permalink
fixed a bug with the get_case() function, where it threw an error whe…
Browse files Browse the repository at this point in the history
…n party was missing for proposers
  • Loading branch information
martigso committed Nov 15, 2024
1 parent dfd7e48 commit 84dc6ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/get_case.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ get_case <- function(caseid = NA, good_manners = 0){
id = tmp |> html_elements("emne > id") |> html_text(),
navn = tmp |> html_elements("emne > navn") |> html_text()),
proposers = data.frame(mp_id = tmp |> html_elements("forslagstiller_liste > representant > id") |> html_text(),
party_id = tmp |> html_elements("forslagstiller_liste > representant > parti > id") |> html_text(),
party_id = sapply(tmp |> html_elements("forslagstiller_liste > representant > parti"),
function(x) ifelse(identical(x |> html_elements("id") |> html_text(), character()),
NA, x |> html_elements("id") |> html_text())),
sub_mp = tmp |> html_elements("forslagstiller_liste > representant > vara_representant") |> html_text()),
publication_references = data.frame(export_id = tmp |> html_elements("publikasjon_referanse > eksport_id") |> html_text(),
link_text = tmp |> html_elements("publikasjon_referanse > lenke_tekst") |> html_text(),
Expand Down

0 comments on commit 84dc6ba

Please sign in to comment.