Learn R Programming

scdtb (version 0.1.0)

process_cond: Process Condition Variable

Description

This is an internal helper function used by raw_plot and randomization_test to process the condition variable in the input data frame. It sets the factor levels and labels of the condition variable based on the provided cond_levels and cond_labels parameters.

Usage

process_cond(.df, .cond, cond_levels, cond_labels)

Value

The input data frame .df with the condition variable processed as a factor with the specified levels and labels.

Arguments

.df

A data frame containing the data to be processed. Must contain a column specified by .cond.

.cond

The name of the column in .df that contains the condition variable.

cond_levels

(Optional) A vector of values indicating the order of condition levels. This is used to set the factor levels of the condition variable.

cond_labels

(Optional) A vector of labels corresponding to the condition levels. These are used for the legend. If not provided, the cond_levels are used as labels.