Simple wrapper for ensuring a string has single quotes at the front and end of the string

afni_quote_expression(x, trim = TRUE)

Arguments

x

character string

trim

should trimws be run first

Value

A character string

Examples

afni_quote_expression("hey")
#> [1] "'hey'"
afni_quote_expression("'hey'")
#> [1] "'hey'"
afni_quote_expression(c("'hey'", "ho", ""))
#> [1] "'hey'" "'ho'"  ""