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 spokesperson
  • Loading branch information
martigso committed Nov 15, 2024
1 parent 84dc6ba commit 9cf0a68
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 @@ -195,7 +195,9 @@ get_case <- function(caseid = NA, good_manners = 0){
step_number = tmp |> html_elements("saksgang_steg > steg_nummer") |> html_text(),
outdated = tmp |> html_elements("saksgang_steg > uaktuell") |> html_text()),
spokespersons = data.frame(mp_id = tmp |> html_elements("saksordfoerer_liste > representant > id") |> html_text(),
party_id = tmp |> html_elements("saksordfoerer_liste > representant > parti > id") |> html_text(),
party_id = sapply(tmp |> html_elements("saksordfoerer_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("saksordfoerer_liste > representant > vara_representant") |> html_text()),
keywords = data.frame(keyword = tmp |> html_elements("stikkord_liste > string") |> html_text()))

Expand Down

0 comments on commit 9cf0a68

Please sign in to comment.