title: number of rows of result is not a multiple of vector length (arg 2) in R
body: <p>I have new question related with this my topic
  <a href="https://stackoverflow.com/questions/50569314/deleting-outlier-in-r-with-account-of-nominal-var/50569520#50569520">deleting outlier in r with account of nominal var</a>.
  In new case variables x and x1 has different lenght</p>
  <pre><code>x &lt;- c(-10, 1:6, 50)
  x1&lt;- c(-20, 1:5, 60)
  z&lt;- c(1,2,3,4,5,6,7,8)
  
  bx &lt;- boxplot(x)
  bx$out
  
  bx1 &lt;- boxplot(x1)
  bx1$out
  
  
  x&lt;- x[!(x %in% bx$out)]
  x1 &lt;- x1[!(x1 %in% bx1$out)]
  
  
  x_to_remove&lt;-which(x %in% bx$out)
  x &lt;- x[!(x %in% bx$out)]
  
  x1_to_remove&lt;-which(x1 %in% bx1$out)
  x1 &lt;- x1[!(x1 %in% bx1$out)]
  
  z&lt;-z[-unique(c(x_to_remove,x1_to_remove))]
  z  
  
  data.frame(cbind(x,x1,z))
  </code></pre>
  <p>then i get the warning</p>
  <pre><code>Warning message:
  In cbind(x, x1, z) :
    number of rows of result is not a multiple of vector length (arg 2)
  </code></pre>
  <p>so in new dataframe the obs. of Z is not corresponding to x and x1.
  How can i decide this problem?
  This solustion is not help me
  <a href="https://stackoverflow.com/questions/40927876/rsolnp-in-cbindtemp-funv-number-of-rows-of-result-is-not-a-multiple-of-vec">Rsolnp: In cbind(temp, funv) : number of rows of result is not a multiple of vector length (arg 1)</a>
  or i just do anything wrong.</p>
  <h1>Edit</h1>
  <pre><code>x_to_remove&lt;-which(x %in% bx$out)
  x &lt;- x[!(x %in% bx$out)]
  
  x1_to_remove&lt;-which(x1 %in% bx1$out)
  x1 &lt;- x1[!(x1 %in% bx1$out)]
  
  z&lt;-z[-unique(c(x_to_remove,x1_to_remove))]
  z  
  
  d=data.frame(cbind(x,x1,z))
  d
  </code></pre>
  <p>it is wrong
  Warning message:</p>
  <pre><code>In cbind(x, x1, z) :
    number of rows of result is not a multiple of vector length (arg 2)
  </code></pre>
  <blockquote>
  <p>d</p>
  </blockquote>
  <pre><code>  x x1 z
  1 1  1 2
  2 2  2 3
  3 3  3 4
  4 4  4 5
  5 5  5 6
  6 6  1 2
  </code></pre>
  <p>How on this 3 columg get this output</p>
  <pre><code>Na  Na  Na
  1   1   2
  2   2   3
  3   3   4
  4   4   5
  5   5   6
  Na  Na  Na
  Na  Na  Na
  </code></pre>
  <p>the six row (d) is superfluous</p>