浏览代码

simplified R code in the pie chart example

Dan Davison 16 年之前
父节点
当前提交
c483c7d087
共有 1 个文件被更改,包括 31 次插入2 次删除
  1. 31 2
      examples.org

+ 31 - 2
examples.org

@@ -10,15 +10,44 @@ To run place the cursor on the =#+begin_src= line of the source block
 labeled directory-pie and press =\C-c\C-c=.
 
 #+srcname: directories
-#+begin_src bash :results :replace
+#+begin_src bash :results replace
 du -sc * |grep -v total
 #+end_src
 
+|   4 | "block"            |
+|  36 | "COPYING"          |
+|   4 | "#dan-notes.org#"  |
+|   4 | "#examples.org#"   |
+|   4 | "examples.org"     |
+| 256 | "existing_tools"   |
+|   4 | "intro.org"        |
+| 144 | "litorgy"          |
+|   4 | "README.markdown"  |
+|  12 | "rorg.html"        |
+|  68 | "#rorg.org#"       |
+|  68 | "rorg.org"         |
+|   8 | "test-export.html" |
+|   4 | "test-export.org"  |
+
 [Eric] I sometimes get weird results here, where R will import the
 labels into the third column instead of the second.  I don't entirely
 trust the R table importing mechanisms so far.
 
 #+srcname: directory-pie
 #+begin_src R :var dirs = directories
-pie(as.vector(t(dirs[1])), labels = as.vector(t(dirs[2])))
+pie(dirs[,1], labels = dirs[,2])
 #+end_src
+
+|   4 | "block"            |
+|  36 | "COPYING"          |
+|   4 | "dan-notes.org"    |
+|   4 | "#examples.org#"   |
+|   4 | "examples.org"     |
+| 256 | "existing_tools"   |
+|   4 | "intro.org"        |
+| 140 | "litorgy"          |
+|   4 | "README.markdown"  |
+|  12 | "rorg.html"        |
+|  68 | "rorg.org"         |
+|   8 | "test-export.html" |
+|   4 | "test-export.org"  |