On Jul 19, 2010, at 4:27 PM, Vikas Rawal wrote:

I have an R script which outputs a small table in the form of a
dataframe. In org-babel, this dataframe is not displayed as an org
table but simply as text laid out as it would be in an R session.

When I export the output to html, I do not get an html table but only
text. How do I make org-babel show a table instead of plain text?

For example, take a simple code block like:

#+BEGIN_SRC R :results output :exports both :session y
 x<-c(1:5)
 y<-x^2
 data.frame(x,y)
#+END_SRC


Vikas



Aloha Vikas,

Is this what you want?

#+BEGIN_SRC R :results value :exports both 
 x<-c(1:5)
 y<-x^2
 data.frame(x,y)
#+END_SRC

#+results:
| 1 |  1 |
| 2 |  4 |
| 3 |  9 |
| 4 | 16 |
| 5 | 25 |

hth,
Tom



Thomas S. Dye, Ph.D.

T. S. Dye & Colleagues, Archaeologists, Inc.

Phone: (808) 529-0866 Fax: (808) 529-0884

http://www.tsdye.com