[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] Wrong results from R source block when returning a list
From: |
Rainer M Krug |
Subject: |
[O] Wrong results from R source block when returning a list |
Date: |
Tue, 03 Nov 2015 13:08:37 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) |
Hi
The following code block returns a wrong table / list:
#+begin_src R :results value list
list(1:10, 1:5)
#+end_src
#+RESULTS:
- (1 1)
- (2 2)
- (3 3)
- (4 4)
- (5 5)
- (6 1)
- (7 2)
- (8 3)
- (9 4)
- (10 5)
The result is actually in R:
#+begin_src R :results output
list(1:10, 1:5)
#+end_src
#+RESULTS:
: [[1]]
: [1] 1 2 3 4 5 6 7 8 9 10
:
: [[2]]
: [1] 1 2 3 4 5
This is likely caused by the recycling rules in R, but it is actually
wrong in the org context:
The shown result is:
#+begin_src R :results table
list(1:10, 1:5)
#+end_src
#+RESULTS:
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
| 5 | 5 |
| 6 | 1 |
| 7 | 2 |
| 8 | 3 |
| 9 | 4 |
| 10 | 5 |
Whil;e I would expect:
#+RESULTS:
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
| 5 | 5 |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
I have no idea if this is a bug or wrong result due to incompatible
types (R list and org table)?
Is this mentioned in the manual?
Rainer
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)
Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa
Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44
Fax (D): +49 - (0)3 21 21 25 22 44
email: address@hidden
Skype: RMkrug
PGP: 0x0F52F982
signature.asc
Description: PGP signature
- [O] Wrong results from R source block when returning a list,
Rainer M Krug <=