title: Repeat n times a subset and plot in R
body: <p>first of all thanks to this forum because I've finded a lot of answers!!
  Now my time to ask for help.
  I can solve this.... function?, loop?... didn't find a good example</p>
  
  <pre><code># from a data.frame = data
  # A:F are name of columns
  
  x&lt;-unique(data$A) # in the example c('var1','var2','var3','var4')
  y&lt;-unique(data$B) # in the example c('varA','varB')
  z&lt;-unique(data$C) # in the example c('var1a','var2a')
  
  # I NEED TO REPEAT THIS (based on x_y_z combinations)#
  x_y_z&lt;-subset(data,data$A==x &amp; data$B==y &amp; data$C==z)
  plot_x_y&lt;-qic(y=D
               ,n=E
               ,x=F  
               ,data=x_y_z
               ,chart = 'p')
  </code></pre>
  
  <p>The idea is to repeat the subsetting and make a plot for each x_y_z combination. The subset should have the name of the variables combinated separated by a '_'. 
  I guess it should work like this:</p>
  
  <pre><code>var1_varA_var1a&lt;-subset(data,data$A==var1 &amp; data$B==varA &amp; data$C==var1a) 
  plot_var1_varA&lt;-qic(y=D
                     ,n=E
                     ,x=F  
                     ,data=var1_varA_var1a
                     ,chart = 'p')
  </code></pre>
  
  <p>And obtain all this plots:</p>
  
  <pre><code>plot_var1_varA_var1a
  plot_var1_varB_var1a
  plot_var1_varA_var2a
  plot_var1_varB_var2a
  plot_var2_varA_var1a
  plot_var2_varB_var1a
  plot_var2_varA_var2a
  plot_var2_varB_var2a
  plot_var3_varA_var1a
  plot_var3_varB_var1a
  plot_var3_varA_var2a
  plot_var3_varB_var2a
  plot_var4_varA_var1a
  plot_var4_varB_var1a
  plot_var4_varA_var2a
  plot_var4_varB_var2a
  </code></pre>
  
  <p>Sorry for the basic question, but I'm stuck on this.</p>
  
  <p>Cristobal</p>