checkValueType: Check if the specified 'valueType' parameter can be passed to...

View source: R/plots-utility-checkValueType.R

checkValueTypeR Documentation

Check if the specified valueType parameter can be passed to the branchvalues of the plot_ly treemap/sunburst visualizations.

Description

If this parameter is set to 'total' and the sum of the counts of the the children nodes is not bigger than the parent node, an empty plot is created. In this case, this function set this parameter to: 'relative'.

Usage

checkValueType(data, vars, valueVar, valueType = "total", labelVars = NULL)

Arguments

data

Data.frame with data.

vars

Character vector with variables of data containing the groups. If multiple, they should be specified in hierarchical order (from parent to child node).

valueVar

String with numeric variable of data containing the value to display.

valueType

String with type of values in valueVar (branchvalues of the plot_ly) function), among others: 'total' (default, only if sum(child) <= to parent) or 'relative'.

labelVars

Named character vector containing variable labels.

Value

If the condition is fullfilled: updated valueType and warning; otherwise input valueType.

Author(s)

Laure Cougnaud


clinDataReview documentation built on March 7, 2023, 5:13 p.m.