Title: | Provides Datasets About Australian Politicians |
Version: | 0.1.0 |
Description: | Provides access to biographical and political data about Australian federal politicians who served between 1901 and 2021. This enhances how reproducible research is that uses this data. |
Depends: | R (≥ 2.10) |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
LazyData: | false |
URL: | https://github.com/RohanAlexander/AustralianPoliticians |
BugReports: | https://github.com/RohanAlexander/AustralianPoliticians/issues |
RoxygenNote: | 7.1.2 |
Imports: | dplyr, readr, purrr, utils, tibble |
Suggests: | rmarkdown, knitr, spelling, testthat (≥ 3.0.0) |
VignetteBuilder: | knitr |
Config/testthat/edition: | 3 |
NeedsCompilation: | no |
Packaged: | 2021-11-29 20:57:22 UTC; rohanalexander |
Author: | Rohan Alexander |
Maintainer: | Rohan Alexander <rohan.alexander@utoronto.ca> |
Repository: | CRAN |
Date/Publication: | 2021-11-30 21:30:04 UTC |
Retrieve a csv dataset from the australian_politicians repository.
Description
'get_auspol()' downloads a requested Australian politicians .csv dataset using an associated argument.
Usage
get_auspol(df)
Arguments
df |
A character string used to request an Australian politicians dataset. *See Request Codes* below. |
Details
There are four request codes: 'all', 'allbyparty', 'mps' and 'senators'.
The specifics of these are:
- 'all' requests the australian_politicians-all.csv dataset. - 'allbyparty' requests the australian_politicians-all-by_party.csv dataset. - 'mps' requests the australian_politicians-mps-by_division.csv dataset. - 'senators' requests the australian_politicians-senators-by_state.csv dataset.
An incorrect request (an argument not associated with a dataset or non-character string argument) will stop function processes and return an error message.
Value
The requested dataset using df
to a user assigned name.
See Also
'show_datacodes()' function help.
Examples
## Not run:
# Request the Senators by State dataset.
senators_df <- get_auspol("senators")
# Preview first 10 observations of the dataset.
head(senators_df, 10)
## End(Not run)
Generate datasets for House of Representative and Senate members service dates.
Description
‘get_reps_senate()' generates a dataset for members’ service time for the Australian House of Representatives, the Australian Senate, or a joined dataset containing values for both the HoR and Senate. Additionally, will produce a set of arguments that can be used as request codes for the individual datasets.
Usage
get_reps_senate(x)
Arguments
x |
A character string used to request a printout of the request code arguments, *see Request Codes* below, or one of three prepared datasets. |
Details
There are four request codes: 'reps_senate', 'reps', 'senate' and 'codes'.
The specifics of these are:
- 'reps_senate' - generates a dataset of HoRs and Senate members; - 'reps' - generates a dataset of HoRs members; - 'senate' - generates a dataset of Senate members; and - 'codes' - returns a tibble of codes used to request data.
An incorrect request code (an argument not associated with a dataset or non-character string argument) will stop function processes and return an error message.
Value
A console printout of a tibble containing arguments to be used with the function,
or the requested dataset using x
assigned to a user created variable.
Examples
## Not run:
# Generate a printout of the arguments.
get_reps_senate("codes")
# Generate combined HoR and Senate dataset.
reps_senate <- get_reps_senate("reps_senate")
# Preview dataset.
head(reps_senate)
# Generate only HoR dataset.
reps <- get_reps_senate("reps")
# Preview dataset.
head(reps)
## End(Not run)
Produce and send to console a tibble of the data request codes and associated datasets.
Description
'show_datacodes()' produces a tibble of the arguments used with the 'get_ausdata()' function and the associated datasets.
Usage
show_datacodes(limit = 4)
Arguments
limit |
A numeric value used to determine the number of values returned. Default is set to four (4) values, which returns all tibble values. |
Details
Items under *Request Codes* can be used to request and download the associated Australian Politicians dataset.
The specifics of these are:
- '"all"' australian_politicians-all.csv. - '"allbyparty"' australian_politicians-all-by_party.csv. - '"mps"' australian_politicians-mps-by_division.csv. - '"senators"' australian_politicians-senators-by_state.csv.
Value
A console printout of a tibble with a designated number of values set by limit
.
See Also
'get_auspol()' function help.
Examples
## Not run:
# Print out dataset request codes.
show_datacodes()
# Request "All" Australian Politicians dataset.
get_auspol("all")
## End(Not run)