knitr::opts_chunk$set(message = FALSE) library(legco) library(httptest) start_vignette("voting")
This database contains voting results of the Council, the House Committee and the Finance Committeeand its subcomittees starting from the fifth term of LegCo.
For more details of the database, see https://www.legco.gov.hk/odata/english/vrdb.html.
Here are the key identifies that is useful for locating the necessary data from the Attendance Database:
VoteTime
is the date and time when a vote is conducted. The lack of a designated unique identifier
means the VoteTime
is the only unique identifier of each individual vote.
TermID
is the numerical ID of a LegCo term. Note that the nominal number of a TermID is less than that
of the term number by 1, i.e. the TermID of the fifth term is 4
.
This database has an ID
which has little value since there is only one data endpoint and
it is not interchangeable with other databases. To locate the bill in other databases, it is
advisable to use the VoteDate
as the filter parameter (e.g. Hansard database) or to find
the CommitteeID of the relevant bill committee using the complimentary function
search_committee()
(e.g. Meeting Schedule Database).
The function in this database has an option to return only the total count of the records
matching the specified parameters instead of returning the data frame containing the result.
To activate this option, specify count = TRUE
:
# Fetch the total number of members absent from the division on the Motion Concerning # the Amendment to the Method for the Selection of the Chief Executive of the HKSAR voting_record(committee = "Council Meeting", from = "2015-06-18", to = "2015-06-18", vote = "absent", count = TRUE)
Sys.sleep(2)
This database is accessible with the following function:
voting_record()
fetches the voting record of one or more Council, the House Committee
and the Finance Committee and its subcomittees meeting(s), or the attendance record of one or more
LegCo member(s) in these meetings. Note that this function takes none of CommitteeID
, SpeakerID
or MemberID
as a filtering parameter. Instead, only the full English committee name and the full
Chinese name of LegCo members can be used.
# Fetch how members voted the motion on "Abolishing the MPF Offsetting Mechanism" on November 11, 2016 v <- voting_record(committee = "Council Meeting", from = "2016-11-16 13:51:53", to = "2016-11-16 13:51:53") head(v)
Sys.sleep(2)
# Fetch the votes that Hon Abraham Shek were abstained from v <- voting_record(name_en = "Abraham SHEK", vote = "abstain") head(v)
# CRAN's build server does not support Chinese characters v <- voting_record(name_en = "Abraham SHEK", vote = "abstain", to = "2020-03-27") head(v)
end_vignette()
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.