product_function: Obtain consumer complaint information about a specific...

Description Usage Arguments Details Value Author(s) Examples

View source: R/product_function.R

Description

It displays various useful summaries of the number of consumer complaints pertaining to different categories of interest for a single product, and puts them in dataframe(s).

Usage

1
2
product_function(product = "Debt collection", subproduct_option = TRUE,
  state_option = TRUE)

Arguments

product

A character input where the user inputs the product category. If the input does not match any of the prescribed product categories on their database, the fuction is stopped. Please note that the user input must always start with a capital letter.

subproduct_option

A logical indicating whether to aggregate all the consumer complaints by sub-product category under the selected product. If (TRUE), such information will be created in the form of a dataframe as the output. Defaults to (TRUE)

state_option

A logical indicating whether to aggregate all the consumer complaints by state category under the selected product. If (TRUE), such information will be created in the form of a dataframe as the output. Defaults to (TRUE)

Details

The function will first try to assess the input of the user, and see if it partially matches any of the prescribed product categories. This is necessary as the product name has to be inputted exactly the same as what is recorded in the consumer complaint database. If the input is accepted, it will display any of the two possible summarization options. If the input is not accept, the user needs to put in the right product name from the list of suggestions. The user can specify whether to include any one or all of the summarization options by specifying (TRUE) or (FALSE).

Value

A list of the dataframe(s) of the options selected. Multiple dataframes are presented as a list because a function can only return one output. As such, by feeding multiple dataframes through a list, multiple outputs can be achieved.

Author(s)

Jae Woong Ham

Examples

1

JaeWHam/WorkSample documentation built on Feb. 18, 2020, 12:26 a.m.