From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Blanchette, Marco" Subject: R code not producing expected results Date: Thu, 12 Aug 2010 23:32:55 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=41873 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ojlwv-0006V7-57 for emacs-orgmode@gnu.org; Fri, 13 Aug 2010 00:32:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ojlwt-0003sO-TA for emacs-orgmode@gnu.org; Fri, 13 Aug 2010 00:32:57 -0400 Received: from mail01.stowers.org ([12.201.176.8]:58990 helo=stowers.org) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ojlwt-0003sG-Nm for emacs-orgmode@gnu.org; Fri, 13 Aug 2010 00:32:55 -0400 Content-Language: en List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "emacs-orgmode@gnu.org" Dear all, Sorry if this is something totally obvious but I am learning to use org-mod= e for my everyday work with R. I just installed the latest stable release o= f org-mode (v7.01g) on top of GNU Emacs 23.1.50.1 (x86_64-apple-darwin10.2.= 0, NS apple-appkit-1038.25). I also installed the CRAN ascii package v0.7 o= n top of R v2.11.1. I am currently working on a MacBook pro with Snow Leopa= rd 10.6.4 Early on today, while reading the org-babel intro, I was able to run the fo= llowing example but somehow, later tonight, it started to break and I spent= the last few hours scratching my head to understand what change and why it= now suddenly break. Your help will be greatly appreciated as I am discover= ing that org-mode in collaboration with org-babel have great potential to h= elp us create more readable report of our daily analysis, as long as I can = get through these early hurdles. Here is the org buffer that now breaks: * Two examples of R code that worked when I started the tutorial but sudden= ly started to fail... ** some R code that should generate a nice table #+BEGIN_SRC R library(ascii) options(asciiType=3D"org") d <- as.data.frame(replicate(4,rnorm(100))) ascii(cor(d),include.rownames=3DT, include.colnames=3DT,header=3DT) #+END_SRC ** Some code straight from [[http://orgmode.org/worg/org-contrib/babel/lang= uages/org-babel-doc-R.php][org-babel]] #+BEGIN_SRC R library(ascii) options(asciiType=3D"org") ascii(summary(table(1:4, 1:4))) #+END_SRC With the following error recover from the *Org-Babel Error* buffer Loading required package: proto Error in as.data.frame.default(x[[i]], optional =3D TRUE) : cannot coerce class 'c("ascii", "proto", "environment")' into a data.fram= e Calls: write.table ... data.frame -> as.data.frame -> as.data.frame.default Execution halted Thanks for the helps. -- Marco Blanchette, Ph.D. Assistant Investigator Stowers Institute for Medical Research 1000 East 50th St. Kansas City, MO 64110 Tel: 816-926-4071 Cell: 816-726-8419 Fax: 816-926-2018