Skip to content

[OT] (slightly) - OpenOffice Calc and text files

2 messages · Schwab,Wilhelm K, Charles C. Berry

#
It will get a good look, as will gnumeric - thanks to all!

Bill
#
On Wed, 13 Oct 2010, Schwab,Wilhelm K wrote:

            
emacs org-mode can convert your tab delimited file to a 'table' that you 
can edit either using org-mode functions OR as plain text by switching to 
fundamental mode.

In emacs speak, just put the cursor at the top of a buffer holding your 
file and do

 	M-x replace-string RET TAB RET | RET

I think, then move your cursor to a line that has a '|' in it and hit TAB, 
and you have a neatly formatted table.

See,

 	http://orgmode.org/worg/org-tutorials/tables.php

for an intro.

A big advantage in using an org-mode table is you can place an R source 
code block further down in the same file, and it can read in the data in 
the table. Then you can go back to the table to edit, then rerun R, ...

I append an example below.

There is a load of tutorial info at

 	http://orgmode.org/worg/org-tutorials/index.php

HTH,

Chuck


#+begin_example
#+tblname: simpleDF
| a | b | c |
|---+---+---|
| 1 | 2 | 3 |
| 5 | 4 | 2 |
|---+---+---|
#+end_example

#+begin_src R :var df=simpleDF :results output :colnames yes

    summary( df )

#+end_src

#+results:
:        a           b             c
:  Min.   :1   Min.   :2.0   Min.   :2.00
:  1st Qu.:2   1st Qu.:2.5   1st Qu.:2.25
:  Median :3   Median :3.0   Median :2.50
:  Mean   :3   Mean   :3.0   Mean   :2.50
:  3rd Qu.:4   3rd Qu.:3.5   3rd Qu.:2.75
:  Max.   :5   Max.   :4.0   Max.   :3.00
Charles C. Berry                            (858) 534-2098
                                             Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu	            UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901