emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-babel's treatment of NA in R source block
@ 2012-10-01 22:54 Vikas Rawal
  2012-10-01 23:10 ` Thomas S. Dye
  0 siblings, 1 reply; 4+ messages in thread
From: Vikas Rawal @ 2012-10-01 22:54 UTC (permalink / raw)
  To: emacs-orgmode

If the result of an R source block contains a data frame with NA, the
NAs are replaced by "nil" when I evaluate the source block. When I
export the file, these appear as nil in the resulting pdf/latex file. 

I would like the NAs to be replaced by blank cells or by a less
obstrusive character like a ".". Is there a simple way I could change
this behaviour?

Vikas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: org-babel's treatment of NA in R source block
  2012-10-01 22:54 org-babel's treatment of NA in R source block Vikas Rawal
@ 2012-10-01 23:10 ` Thomas S. Dye
  2012-10-03  7:16   ` Vikas Rawal
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas S. Dye @ 2012-10-01 23:10 UTC (permalink / raw)
  To: emacs-orgmode

Vikas Rawal <vikaslists@agrarianresearch.org> writes:

> If the result of an R source block contains a data frame with NA, the
> NAs are replaced by "nil" when I evaluate the source block. When I
> export the file, these appear as nil in the resulting pdf/latex file. 
>
> I would like the NAs to be replaced by blank cells or by a less
> obstrusive character like a ".". Is there a simple way I could change
> this behaviour?
>
> Vikas
>
>
Aloha Vikas,

One route might be the ascii package in R, which exports objects to
several markup languages, including Org. The ascii() argument na.print
is a character string that specifies how NA should appear in the output.

All the best,
Tom

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: org-babel's treatment of NA in R source block
  2012-10-01 23:10 ` Thomas S. Dye
@ 2012-10-03  7:16   ` Vikas Rawal
  2012-10-03  7:40     ` Thomas S. Dye
  0 siblings, 1 reply; 4+ messages in thread
From: Vikas Rawal @ 2012-10-03  7:16 UTC (permalink / raw)
  To: emacs-orgmode

> >
> > I would like the NAs to be replaced by blank cells or by a less
> > obstrusive character like a ".". Is there a simple way I could change
> > this behaviour?
> >
> > Vikas
> >
> >
> Aloha Vikas,
> 
> One route might be the ascii package in R, which exports objects to
> several markup languages, including Org. The ascii() argument na.print
> is a character string that specifies how NA should appear in the output.
> 

Thanks. That seems very good.

But if the code block is directly producing org markup, what should I
tell my parent org file to expect?

My source block began like this:

#+BEGIN_SRC R :results value :colnames yes :hline yes

I would expect this to change now. How do I say that the result is
already formatted for org?

Vikas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: org-babel's treatment of NA in R source block
  2012-10-03  7:16   ` Vikas Rawal
@ 2012-10-03  7:40     ` Thomas S. Dye
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas S. Dye @ 2012-10-03  7:40 UTC (permalink / raw)
  To: emacs-orgmode

Vikas Rawal <vikaslists@agrarianresearch.org> writes:

>> >
>> > I would like the NAs to be replaced by blank cells or by a less
>> > obstrusive character like a ".". Is there a simple way I could change
>> > this behaviour?
>> >
>> > Vikas
>> >
>> >
>> Aloha Vikas,
>> 
>> One route might be the ascii package in R, which exports objects to
>> several markup languages, including Org. The ascii() argument na.print
>> is a character string that specifies how NA should appear in the output.
>> 
>
> Thanks. That seems very good.
>
> But if the code block is directly producing org markup, what should I
> tell my parent org file to expect?
>
> My source block began like this:
>
> #+BEGIN_SRC R :results value :colnames yes :hline yes
>
> I would expect this to change now. How do I say that the result is
> already formatted for org?
>
> Vikas
>
>
Does ":results value raw" do what you want?  Another possibility is
":results value org", which changed behavior recently.

All the best,
Tom
-- 
Thomas S. Dye
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-03  7:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-01 22:54 org-babel's treatment of NA in R source block Vikas Rawal
2012-10-01 23:10 ` Thomas S. Dye
2012-10-03  7:16   ` Vikas Rawal
2012-10-03  7:40     ` Thomas S. Dye

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).