Skip to content
Prev 369644 / 398503 Next

Force argument to have quotes

Bert has suggested there are better ways to do what you want.  But if you want to continue down the path you have started and you want to decide whether to quote based on the variable Class, something like this might work for you  

myOptions <- with(myFunction1Vals, paste(Argument, ifelse(Class=='character',shQuote(Value), Value), sep = '=', collapse = ","))


Hope this helps,

Dan

Daniel Nordlund, PhD
Research and Data Analysis Division
Services & Enterprise Support Administration
Washington State Department of Social and Health Services