surround_quote_if_needed {DisImpact}R Documentation

Helper function: Surround character values with double quotes if not present.

Description

Function used internally by di_calc_sql and di_iterate_sql to surround variable names by double quotes in SQL queries in order to support non-alphanumeric characters in variable names.

Usage

surround_quote_if_needed(value)

Arguments

value

A character vector.

Value

A character vector with double quotes surrounding value if the first and last characters of value aren't yet double quotes. For value that is already surrounded by double quotes, nothing is changed.


[Package DisImpact version 0.0.21 Index]