Package 'AustralianPoliticians'

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] , Paul A. Hodgetts [aut]
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

Help Index


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. - '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.

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)