Skip to content
Advertisement

Replace multiple variables in R Sql Query

I have a query similar like the one below where I need to use multiple string of characters to replace in a single query.

I am not too sure how to make sure a and b are passed into the %s in the query.

I am getting the error ‘unused arguments (b)’

Any advice please?

Thanks

Advertisement

Answer

sQuote only takes one vector as an argument. You can’t give it a and b at the same time as separate arguments. And collapse is an argument for paste, not for toString. And sprintf will want separate arguments for each %s. I think you want

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement