Skip to contents

This function returns an Excel cell range for a given column in a dataframe. The range is formatted for use in Excel functions or formulas and is prefixed with the sheet name 'validation_rules'.

Usage

create_col_range(variable, data.val)

Arguments

variable

The name of the column/question for which the Excel range is to be generated.

data.val

A dataframe containing the column specified by variable.

Value

A string representing the Excel cell range containing all choices for the column variable in the sheet 'validation_rules'.

Examples

# Assume df is a sample dataframe with a column named 'consent'.
# range_string <- create_col_range('consent', df)