create_var_positions: Create Variable Positions

View source: R/utils.R

create_var_positionsR Documentation

Create Variable Positions

Description

Generates a data frame containing variable names from cat_c_colors and corresponding x and y offsets based on the number of variables.

Usage

create_var_positions(cat_c_colors, num_vars)

Arguments

cat_c_colors

A named vector of colors for variables in category C. The names correspond to variable names.

num_vars

The number of variables. Supported values are "3", "4", "5", or "6".

Value

A data frame with columns:

var

Factor of variable names from cat_c_colors.

x_offset

Numeric x-axis offset for plotting.

y_offset

Numeric y-axis offset for plotting.

Examples

library(dplyr)
cat_c_colors <- c("Var1" = "red", "Var2" = "blue", "Var3" = "green")
create_var_positions(cat_c_colors, 3)

diceplot documentation built on June 25, 2025, 1:08 a.m.