transform_response: Transforms a response variable into a valid factor that can...

View source: R/response.R

transform_responseR Documentation

Transforms a response variable into a valid factor that can be processed downstream.

Description

transform_response transforms response so that it can be processed in further steps. Function transforms input into a factor of values 1 and 0 corresponding to the condition of interest and absence of it respectively.

Usage

transform_response(response, .condition = NULL)

Arguments

response

A factor, integer or character vector of categories.

Details

By default function takes some assumption on how to make transformation, depending on the class of response:

  • factor. Function considers the condition of interest first level in factor.

  • integer. Function considers the condition of interest the min value of\ response.

  • character. Function considers the condition of interest the first value in unique(response) after using sort.

Value

factor of levels ⁠(0,1)⁠, where 1 represents the condition of interest and 0 absence of it.


ROCnGO documentation built on Aug. 8, 2025, 6:07 p.m.