emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] R contingency table axes labels in org


From: Thomas S. Dye
Subject: Re: [O] R contingency table axes labels in org
Date: Mon, 04 Nov 2013 06:52:52 -1000

Jarmo Hurri <address@hidden> writes:

> Greetings again.
>
> I need to represent a contingency table generated by R in an org file. R
> output shows the labes of the vertical and the horizontal axes, but
> these are pruned from the output in org-mode. Is there a nice way to
> reintroduce the axes labels?
>
> # ----------------------------------------------------------------------
> * interesting data
>   #+BEGIN_SRC R :exports results :rownames yes :colnames yes
>     org.files <- c (1, 0, 2, 2, 2, 2, 1)
>     happiness <- c (1, 0, 2, 2, 2, 1, 2)
>     data <- data.frame (org.files, happiness)
>     table (data)
>   #+END_SRC
>
>   #+RESULTS:
>   |   | 0 | 1 | 2 |
>   |---+---+---+---|
>   | 0 | 1 | 0 | 0 |
>   | 1 | 0 | 1 | 1 |
>   | 2 | 0 | 1 | 3 |
> # ----------------------------------------------------------------------
>
> All the best,
>
> Jarmo
>
>
>

library(ascii)
...
print(ascii(table(data)), type="org")

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]