[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] R contingency table axes labels in org
From: |
Jarmo Hurri |
Subject: |
Re: [O] R contingency table axes labels in org |
Date: |
Mon, 04 Nov 2013 19:30:50 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) |
address@hidden (Thomas S. Dye) writes:
> library(ascii)
> ...
> print(ascii(table(data)), type="org")
Great tip. I even got the result out as an interpreted org table by
using ":results output raw". (For example, without "raw" it becomes
literal.) Thanks!
* interesting data
#+BEGIN_SRC R :exports results :results output raw
library (ascii)
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)
print (ascii (table (data)), type = "org")
#+END_SRC
#+RESULTS:
| | | *happiness* | | |
| | | 0 | 1 | 2 |
|-------------+---+-------------+------+------|
| *org.files* | 0 | 1.00 | 0.00 | 0.00 |
| | 1 | 0.00 | 1.00 | 1.00 |
| | 2 | 0.00 | 1.00 | 3.00 |
Jarmo