ConvertSpacesToTabs: Replace leading spaces in code files with tabs

convert_space2tabR Documentation

Replace leading spaces in code files with tabs

Description

Format code by replacing leading spaces with tabs to allow for block indentation

Usage

convert_space2tab(x)

Arguments

x

A string containing source code

Details

For proper code generation, code that is autogenerated must be available for debugging when required.

To allow for this requirement, most of the code has to be indented in a format that the IDE in use would have indented it if it was written manually.

For this, spaces have to be tabbed as required by RStudio, our editor of choice (bias!!).

This utility function is used to format any custom code for the IDE and is purely for aesthetic purposes.

Value

Properly indented source code


smockin/RedcapData documentation built on Feb. 2, 2023, 3:19 a.m.