title: R: is there an equivalent to applying Excel's locked cell reference to an entire field's calculations?
body: <p>I'm trying to migrate a simulation/calculator from Excel to R. However, I'm having trouble finding the R equivalents in Excel.</p>
  <p>I eventually plan on having the simulation/calculator on either Rmarkdown or shiny.</p>
  <p>For this issue, I'm trying to replicate calculating against a locked cell reference.</p>
  <p>I have two separate tables.</p>
  <p><strong>Table 1</strong></p>
  <pre><code>x   y   z
  0.5 0.3 120
  </code></pre>
  <p><strong>Table 2</strong></p>
  <pre><code>a  b
  32 33
  7  22
  65 11
  43 21
  3  45
  </code></pre>
  <p>Table 1 is designed for inputs to be changed frequently by the user. If this was shiny I suppose it would be the sliding scale.</p>
  <p>For Table 2, I want to add a calculated field multiplying each &quot;cell&quot; by Table 1's x, which is 0.5.</p>
  <p>If this was excel, I would add two $ signs to the cell to lock the cell reference. The equation would be <code>Table 2(C2) = Table 2(A2) * Table 1($X$2), Table 2(C3) = Table 2(A3) * Table 1($X$2)</code>.</p>
  <p>The end goal is that the results in Table 2 are graphed in shiny.</p>
  <p>In R, I have the following:</p>
  <pre><code>Table2$c &lt;- Table2$a * Table1$x
  </code></pre>
  <p>However, I am getting an error. I'm not sure if it is because the table size must be the same. If that's the case, is there syntax to <em>lock</em> a calculation? For example if I just put</p>
  <pre><code>Table2$c &lt;- Table2$a * 0.5
  </code></pre>
  <p>I don't think there would be an issue. But I want that 0.5 to be able to change dynamically. Do I need to make an interim step to transform Table 1 to the same size as Table 2 and reiterate x?</p>
  <p>Thanks</p>