From: "Blanchette, Marco" <MAB@stowers.org>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: R code not producing expected results
Date: Thu, 12 Aug 2010 23:32:55 -0500 [thread overview]
Message-ID: <C88A3527.16634%mab@stowers.org> (raw)
Dear all,
Sorry if this is something totally obvious but I am learning to use org-mode for my everyday work with R. I just installed the latest stable release of 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 on top of R v2.11.1. I am currently working on a MacBook pro with Snow Leopard 10.6.4
Early on today, while reading the org-babel intro, I was able to run the following 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 discovering that org-mode in collaboration with org-babel have great potential to help 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 suddenly started to fail...
** some R code that should generate a nice table
#+BEGIN_SRC R
library(ascii)
options(asciiType="org")
d <- as.data.frame(replicate(4,rnorm(100)))
ascii(cor(d),include.rownames=T, include.colnames=T,header=T)
#+END_SRC
** Some code straight from [[http://orgmode.org/worg/org-contrib/babel/languages/org-babel-doc-R.php][org-babel]]
#+BEGIN_SRC R
library(ascii)
options(asciiType="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 = TRUE) :
cannot coerce class 'c("ascii", "proto", "environment")' into a data.frame
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
next reply other threads:[~2010-08-13 4:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-13 4:32 Blanchette, Marco [this message]
2010-08-13 6:23 ` R code not producing expected results Thomas S. Dye
2010-08-13 6:57 ` Charles C. Berry
[not found] ` <1668ca$1opjg@mail.curie.net>
2010-08-13 8:19 ` David Hajage
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C88A3527.16634%mab@stowers.org \
--to=mab@stowers.org \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.