title: removing NaN using dplyr
body: <p>I am trying to remove the NaN values and sort by the row.names. I tried to do this using dplyr, but my attempt didnt work. Can someone suggest a way to fix it? </p>
  
  <pre><code>require(markovchain)
  data1&lt;-data.frame(dv=rep(c("low","high"),3),iv1=sample(c("A","B","C"),replace=T,6))
  markov&lt;-markovchainFit(data1)
  markovDF&lt;-as(markov, "data.frame")
  library(dplyr)
  markovDF%&gt;%filter(rowSums&gt;0)%&gt;%arrange(desc(markovDF[,1]))
  
  
  &gt; markov
  $estimate
               A         B         C high low
  A          NaN       NaN       NaN  NaN NaN
  B          NaN       NaN       NaN  NaN NaN
  C          NaN       NaN       NaN  NaN NaN
  high 0.3333333 0.0000000 0.6666667    0   0
  low  0.6666667 0.3333333 0.0000000    0   0
  </code></pre>
  
  <p>GOAL:</p>
  
  <pre><code>      A    B  C  high low
  high .33 .00 .67  0    0
  low  .67 .33  .00 0    0
  </code></pre>