Hi, Ihor, Ihor Radchenko <[email protected]> writes:
> Christian Moe <[email protected]> writes: > >> But I realize I spoke too soon about the need to document it in the >> manual, since it's not implemented for all languages. It apparently >> still isn't for R. (Possibly for the good reason that one can and should >> use R colnames.) > > Looking at the code, it should. Can you provide a failing example? I haven't looked at the code, but it fails for me. The below examples try to match the output for the elisp example I posted before: #+RESULTS: | Odd | Even | |-----+------| | 1 | 2 | | 3 | 4 | | 5 | 6 | With an R data frame, the result has the R colnames, not the ones from the Babel colnames header. #+begin_src R :colnames '("Odd" "Even") data.frame(a=c(1,3,5), b=c(2,4,6)) #+end_src #+RESULTS: | a | b | |---+---| | 1 | 2 | | 3 | 4 | | 5 | 6 | Not unreasonable, since R data frames already provide colnames. With a simple array, too, R's default "V<n>" colnames prevail: #+begin_src R :colnames '("Odd" "Even") t(array(1:6, dim=c(2,3))) #+end_src #+RESULTS: | V1 | V2 | |----+----| | 1 | 2 | | 3 | 4 | | 5 | 6 | > Are you sure about scheme? I'm never sure about scheme (still stuck in SICP chapter 2.3). :-) But when I try (using geiser and guile), I don't get any colnames. #+begin_src scheme :colnames '("Odd" "Even") '((1 2) (3 4) (5 6)) #+end_src #+RESULTS: | 1 | 2 | | 3 | 4 | | 5 | 6 | This contrasts with elisp, where it works: #+begin_src elisp :colnames '("Odd" "Even") '((1 2) (3 4) (5 6)) #+end_src It also works in perl and python. #+begin_src perl :colnames '("Odd" "Even") my @items = ([1,2],[3,4],[5,6]); \@items; #+end_src #+headers: :python python3 #+begin_src python :colnames '("Odd" "Even") return [[1,2],[3,4],[5,6]] #+end_src That's as far as I've tested. Regards, Christian
