title: R put all possible combinations of 2 sets of variables in for loop
body: <p>I have 2 strings of variables that I would like to combine to get every possible combination in R. My ultimate goals is to take all these combinations that refer to data in different data frame variables and include them in a for statement for writing pdfs for each combination. For example, </p>
  
  <pre><code>A &lt;- c(a, b, c)
  B &lt;- c(1, 2, 3)
  </code></pre>
  
  <p>I would like to end up being able to write, 
  for all combinations of A = x and B = y... </p>
  
  <p>How do I do this? Can I instruct this within a for statement? Or, do I need to make some sort of string combining A*B first? Either way, I need help with the syntax. Thank you!</p>