Title: | Provides Datasets About Australian Politicians |
---|---|
Description: | Provides access to biographical and political datasets (<https://github.com/RohanAlexander/australian_politicians/tree/master/data>) about Australian federal politicians who served between 1901 and 2021. This enhances how reproducible research is that uses this data. |
Authors: | Rohan Alexander [aut, cre] |
Maintainer: | Rohan Alexander <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2025-01-24 02:53:34 UTC |
Source: | https://github.com/rohanalexander/australianpoliticians |
'get_auspol()' downloads a requested Australian politicians .csv dataset using an associated argument.
get_auspol(df)
get_auspol(df)
df |
A character string used to request an Australian politicians dataset. *See Request Codes* below. |
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. - 'ministries' requests the australian_politicians-ministries.csv dataset. - 'aphID' requests the australian_politicians-uniqueID_to_aphID.csv dataset. - 'aph_ministries' requests the australian_politicians-uniqueID_to_aph_ministries.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.
The requested dataset using df
to a user assigned name.
'show_datacodes()' function help.
## 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)
## 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)
‘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.
get_reps_senate(x)
get_reps_senate(x)
x |
A character string used to request a printout of the request code arguments, *see Request Codes* below, or one of three prepared datasets. |
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.
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.
## 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)
## 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)
'show_datacodes()' produces a tibble of the arguments used with the 'get_ausdata()' function and the associated datasets.
show_datacodes(limit = 4)
show_datacodes(limit = 4)
limit |
A numeric value used to determine the number of values returned. Default is set to four (4) values, which returns all tibble values. |
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.
A console printout of a tibble with a designated number of values set by limit
.
'get_auspol()' function help.
## Not run: # Print out dataset request codes. show_datacodes() # Request "All" Australian Politicians dataset. get_auspol("all") ## End(Not run)
## Not run: # Print out dataset request codes. show_datacodes() # Request "All" Australian Politicians dataset. get_auspol("all") ## End(Not run)