R for loop in a formula
<p>I need a for loop inside a formula in R. "Normal" loops are pretty straightforward in R (See for example here <a href="https://www.r-bloggers.com/how-to-write-the-first-for-loop-in-r/" rel="nofollow">https://www.r-bloggers.com/how-to-write-the-first-for-loop-in-r/</a>) However because there are " " in my formula it does not appear to work... Does anyone knows a way around this? In this formula I want ID1 to be a variable of which I have a list of 500 different IDs</p>

<pre><code>testing &lt;- formula(paste("STATUS ~ as.factor(data$TEMP) + C1 + ID1 * ID2 "))
</code></pre>