title: r barplot descending order with matrix data with one column
body: <p>I have a matrix data:</p>
  
  <pre><code>data &lt;- prop.table(df,2)*100
  
     [,1]
  FR 63.60582
  US 15.90146
  DE 10.07839
  UK 10.41433
  </code></pre>
  
  <p>I do a barplot of it:</p>
  
  <pre><code>barplot(data ,beside=TRUE,legend.text=T,
          ylim=c(0,100),ylab="Percentages",
          args.legend = list(x ='topright', bty='n', inset=c(-0.5,0)))
  </code></pre>
  
  <p>it is not ordered <strong>descending</strong>, so I try to order it like:</p>
  
  <pre><code>data &lt;- data [order(data $V1),]
  </code></pre>
  
  <p>and I get:</p>
  
  <pre><code>Error in data$V1 : $ operator is invalid for atomic vectors
  </code></pre>
  
  <p>so I try to convert to dataframe:</p>
  
  <pre><code>data &lt;- as.data.frame(data)
  </code></pre>
  
  <p>and then do a barplot with it, but I get:</p>
  
  <pre><code>Error in barplot.default(data, beside = TRUE, legend.text = T, ylim = c(0,  : 
    'height' must be a vector or a matrix
  </code></pre>
  
  <p>I have the impression that I am stuck in a vicious circle here. Could somebody get me out of this chaos? thanks.</p>
  
  <h2>update:</h2>
  
  <p>dput(data) gives me:</p>
  
  <pre><code>structure(c(63.6058230683091, 15.9014557670773, 10.0783874580067, 
  10.4143337066069), .Dim = c(4L, 1L), .Dimnames = list(c("FR", 
  "US", "DE", "UK"), NULL))
  </code></pre>