I want an output such as
N(X(1), newx="gen")
I tried to use the following code
try1 <- sprintf("N(X(,%d),newx="gen" )",seq.int(1))
But the above R code gives error. Now how could I do this with sprintf? Any suggestion is extremely appreciated. nb i am quite new to r.
You need to escape the quotation marks:
Regarding OP's edit: