load_lawmaker_models: Loads pre-generated lawmaker models based on LDA model topic...

Description Usage Arguments Value

View source: R/load_lawmaker_models.R

Description

Returns nested data frames containing the dot product of a sparse sponsorship matrix and the Gibbs-type LDA models generated using the topicmodels::LDA function. These models were generated on the entire legislative dataset from 2001-2019. Because the generation is time-consuming, the individuals models have been saved for ease of reloading. The models take up > 50 MB of space in the aggregate, so they are saved individually. This function permits topics within a specified range to be loaded. #'

Usage

1
load_lawmaker_models(datadir = NULL, topics = NULL)

Arguments

datadir

A directory containing lawmaker models in nested dataframe format. If NULL, the inst/extdata and extdata directories are searched in the installation directory. The inst/extdata directory should be explicitly declared to use all files, as only a few models are provided in the installation.

topics

An integer or a vector of integers. Defaults to first 10.

Value

A nested dataframe with a column named lawmaker_models for each of the topics specified.


titaniumtroop/aRlegislation documentation built on May 4, 2020, 3:24 a.m.