Learn R Programming

tidyfinance (version 0.4.3)

breakpoint_options: Create Breakpoint Options for Portfolio Sorting

Description

This function generates a structured list of options for defining breakpoints in portfolio sorting. It includes parameters for the number of portfolios, percentile thresholds, exchange-specific breakpoints, and smooth bunching, along with additional optional parameters.

Usage

breakpoint_options(
  n_portfolios = NULL,
  percentiles = NULL,
  breakpoint_exchanges = NULL,
  smooth_bunching = FALSE,
  ...
)

Value

A list of class "tidyfinance_breakpoint_options" containing the provided breakpoint options, including any additional arguments passed via ....

Arguments

n_portfolios

Integer, optional. The number of portfolios to create. Must be a positive integer. If not provided, defaults to NULL.

percentiles

Numeric vector, optional. A vector of percentile thresholds for defining breakpoints. Each value should be between 0 and 1. If not provided, defaults to NULL.

breakpoint_exchanges

Character, optional. A non-empty string specifying the exchange for which the breakpoints apply. If not provided, defaults to NULL.

smooth_bunching

Logical, optional. Indicates whether smooth bunching should be applied. Defaults to FALSE.

...

Additional optional arguments. These will be captured in the resulting structure as a list.

Examples

Run this code
breakpoint_options(
  n_portfolios = 5,
  percentiles = c(0.2, 0.4, 0.6, 0.8),
  breakpoint_exchanges = "NYSE",
  smooth_bunching = TRUE,
  custom_threshold = 0.5,
  another_option = "example"
)

Run the code above in your browser using DataLab