From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastien Vauban Subject: Adding `sort' in R makes the output fail Date: Thu, 23 Oct 2014 16:37:08 +0200 Message-ID: <86bnp2g8dn.fsf@example.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hello, The following code does return a corrupted answer, while it's supposed to return a sorted dataframe. --8<---------------cut here---------------start------------->8--- #+BEGIN_SRC R :results value replace con <- textConnection(" index email A abc-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org B def-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org C def-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org D ghi-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org E abc-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org F def-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org") df <- read.table(con, header = TRUE) sort(table(df$email)) #+END_SRC #+results: | 1 | | 2 | | 3 | --8<---------------cut here---------------end--------------->8--- See video at http://screencast.com/t/4u4Sj1Mkycwp to see the effect of adding `sort', and see the output in RStudio (correct in both cases: with and without `sort') on the right side of the video. What's wrong here? Best regards, Seb -- Sebastien Vauban