On Thu, 19 Feb 2015, Sebastien Vauban wrote:
#+PROPERTY: session *R*
* Source
#+name: table
| ID | User1 | User2 |
|---------+-------+-------|
| 26/0163 | lrp | nil |
| 37/0001 | nil | nil |
| 37/0003 | nil | nil |
[snip]
* First column (with name)
When I try to get the first column printed along with its name ("ID"), I have
troubles doing so...
#+begin_src R :var df=table :colnames yes
df[, 1]
#+end_src
Try this:
,----
| #+begin_src R :var df=table :colnames yes
| df[, 1,drop=FALSE]
| #+end_src
|
| #+RESULTS:
| | ID |
| |---------|
| | 26/0163 |
| | 37/0001 |
| | 37/0003 |
`----
Look at
#+BEGIN_SRC R :results output
example(`[.data.frame`)
#+END_SRC
for some help on this.
HTH,
Chuck