emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dan Davison <davison@stats.ox.ac.uk>
To: Graham Smith <myotisone@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [babel] R - variable names in summary
Date: Wed, 09 Dec 2009 14:14:28 -0500	[thread overview]
Message-ID: <87vdggdkob.fsf@stats.ox.ac.uk> (raw)
In-Reply-To: <2c75873c0912090905y5d673fe3m879e7e79e77f3c89@mail.gmail.com> (Graham Smith's message of "Wed, 9 Dec 2009 17:05:48 +0000")

Graham Smith <myotisone@gmail.com> writes:

> Dan,
>
>>> The colnames t works as expected, but how do I then see the variable
>>> names when using the summary command,
>>
>> Just use :colnames t again for that.
>
> Thanks again, I almost had this solved but in
>
> #+begin_src R :session babeltest :colnames t
>
> I hadn't left a space between the end of babeltest and the :
>
> But I would never have figured out the :results output  method, however.

OK, it would be really helpful if you could let us know how we should
improve the documentation of it.

>
> Next question is is to do with output with things like summary. In R
> if you have lots of variables,the output wraps so it fits on the
> screen. With babel it runs off the edge of the page. is there a quick
> way of getting the output to fit an anticipated a4 pdf output.

I'd suggest using :results output, and controlling the width of the
output with options(width=whatever) in R. E.g.

#+begin_src R :session babeltest :colnames t :results output
options(width=80)
summary(cbind(babeltest, babeltest))
#+end_src

#+results:
#+begin_example
       ID             var1           var2          var3             ID       
 Min.   : 1.00   Min.   :23.0   Min.   :1.0   Min.   :200.0   Min.   : 1.00  
 1st Qu.: 3.25   1st Qu.:34.0   1st Qu.:4.0   1st Qu.:355.0   1st Qu.: 3.25  
 Median : 5.50   Median :45.5   Median :5.0   Median :425.0   Median : 5.50  
 Mean   : 5.50   Mean   :48.4   Mean   :4.8   Mean   :418.9   Mean   : 5.50  
 3rd Qu.: 7.75   3rd Qu.:56.0   3rd Qu.:6.0   3rd Qu.:499.8   3rd Qu.: 7.75  
 Max.   :10.00   Max.   :89.0   Max.   :7.0   Max.   :600.0   Max.   :10.00  
      var1           var2          var3      
 Min.   :23.0   Min.   :1.0   Min.   :200.0  
 1st Qu.:34.0   1st Qu.:4.0   1st Qu.:355.0  
 Median :45.5   Median :5.0   Median :425.0  
 Mean   :48.4   Mean   :4.8   Mean   :418.9  
 3rd Qu.:56.0   3rd Qu.:6.0   3rd Qu.:499.8  
 Max.   :89.0   Max.   :7.0   Max.   :600.0
#+end_example

I don't think either org or org-babel has any way to automatically wrap
wide tables. Also bear in mind the tranpose function in R (t), although
that's not helpful for this summary output, which is a rather weird
table, not a standard matrix or data frame.

Dan

>
> I appreciate this may be more an Emacs/orgmode question than a babel one.
>
> Graham
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2009-12-09 19:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-08 23:50 [babel] R - variable names in summary Graham Smith
2009-12-09  4:38 ` Austin Frank
2009-12-09 16:46   ` Graham Smith
2009-12-09 16:38 ` Dan Davison
2009-12-09 17:05   ` Graham Smith
2009-12-09 19:14     ` Dan Davison [this message]
2009-12-09 20:33       ` Graham Smith
2009-12-09 20:44         ` Dan Davison
2009-12-09 21:00           ` Graham Smith
2009-12-09 20:51         ` Thomas S. Dye
2009-12-09 21:06           ` Graham Smith
2009-12-09 20:49       ` Austin Frank
2009-12-09 21:12         ` Graham Smith
2009-12-09 22:28         ` Dan Davison

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=87vdggdkob.fsf@stats.ox.ac.uk \
    --to=davison@stats.ox.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=myotisone@gmail.com \
    /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).