Fetch voting records of LegCo council, the Finance Committee and its subcommittees and the House Committee meetings.

voting_record(
  committee = NULL,
  term_id = NULL,
  result = "all",
  vote = "all",
  name_ch = NULL,
  name_en = NULL,
  separate_mechanism = NULL,
  mover_type = "all",
  from = "1900-01-01 00:00:00",
  to = Sys.time(),
  n = 10000,
  extra_param = NULL,
  count = FALSE,
  verbose = TRUE
)

legco_voting_record(
  committee = NULL,
  term_id = NULL,
  result = "all",
  vote = "all",
  name_ch = NULL,
  name_en = NULL,
  separate_mechanism = NULL,
  mover_type = "all",
  from = "1900-01-01 00:00:00",
  to = Sys.time(),
  n = 10000,
  extra_param = NULL,
  count = FALSE,
  verbose = TRUE
)

Arguments

committee

the name of the committee or subcommittee. Defaults to NULL.

term_id

the id of a term, or a vector of ids. If NULL, returns results of all terms. Defaults to NULL.

result

the voting result. If "passed", returns motions that have been passed. If "vetoed", returns motions that have been vetoed.If "all", returns all motions that has been voted in LegCo. Defaults to all.

vote

the vote cast. If "yes", returns only members who cast affirmative votes. If "no", returns only members who cast negative votes. If "abstain", returns only members who abstained from voting. If "absent", returns only members who were absent. If "present", returns only members who were present and did not vote (e.g. President). If "all", returns all votes. Defaults to "all".

name_ch

the name of a LegCo member in Traditional Chinese, or a vector of names. If NULL, returns voting records of all members. Defaults to NULL.

name_en

the name of a LegCo member in English, or a vector of names. If the member has an English name, the English name should go first followed by the surname in capital letters, e.g. "Peter CHAN". If the member does not have an English name, the surname in capital letters should go first followed by the translated first name with a hyphen separating the different syllable, e.g. "CHAN Tai-man". Check the names of the members with member(). If NULL, returns voting records of all members. Defaults to NULL.

separate_mechanism

only fetch votes that were counted with the vote separate mechanism, i.e. requiring majority in both geographical and functional constituencies to pass. If NULL, returns all votes regardless of the vote counting mechanism used. Defaults to NULL.

mover_type

the type of motion being put on vote. If "PO", returns votes on government motions only. If "MB", returns votes on members' motions only. If "all", returns votes on all motions. Defaults to "all".

from

only fetch results of meetings on or after this date and time. Accepts character values in "YYYY-MM-DD" or "YYYY-MM-DD HH:MM:SS" format, and objects of class Date, POSIXt, POSIXct, POSIXlt or anything else that can be coerced to a date with as.Date(). Defaults to "1900-01-01 00:00:00".

to

only fetch results of meetings on or before this date and time. Accepts character values in "YYYY-MM-DD" or "YYYY-MM-DD HH:MM:SS" format, and objects of class Date, POSIXt, POSIXct, POSIXlt or anything else that can be coerced to a date with as.Date(). Defaults to the current system time.

n

the number of record to fetch. Defaults to 1000.

extra_param

additional query parameters defined in LegCo API. Must begin with "&".

count

logical: Whether to return only the total count of records that matches the parameter(s) instead of the result. Defaults to FALSE.

verbose

logical: Whether to display progress messages when fetching data? Defaults to TRUE.

Details

This function corresponds to the vVotingResult data endpoint of the Voting Result Database.

See also

LegCo API documentation for the Voting Record database: https://www.legco.gov.hk/en/open-legco/open-data/voting-result-database.html

Examples

# \donttest{
# Fetch how members voted the motion on
# Abolishing the MPF Offsetting Mechanism on November 11, 2016
x <- voting_record(committee = "Council Meeting",
                   from = "2016-11-16 13:51:53",
                   to = "2016-11-16 13:51:53")
#> Retrieving records...
#> Retrieved 68 record(s). 68 record(s) available in total.
# }