emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tsd@tsdye.com (Thomas S. Dye)
To: Jarmo Hurri <jarmo.hurri@syk.fi>
Cc: emacs-orgmode@gnu.org
Subject: Re: R contingency table axes labels in org
Date: Mon, 04 Nov 2013 06:52:52 -1000	[thread overview]
Message-ID: <m1mwlk3y8r.fsf@tsdye.com> (raw)
In-Reply-To: <871u2wm9sw.fsf@syk.fi> (Jarmo Hurri's message of "Mon, 04 Nov 2013 18:05:51 +0200")

Jarmo Hurri <jarmo.hurri@syk.fi> 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	other threads:[~2013-11-04 16:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-04 16:05 R contingency table axes labels in org Jarmo Hurri
2013-11-04 16:52 ` Thomas S. Dye [this message]
2013-11-04 17:30   ` Jarmo Hurri

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1mwlk3y8r.fsf@tsdye.com \
    --to=tsd@tsdye.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jarmo.hurri@syk.fi \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).