emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 9014577 3/3: test-ob-R.el: add tests for how NA val


From: ELPA Syncer
Subject: [elpa] externals/org 9014577 3/3: test-ob-R.el: add tests for how NA values are printed
Date: Sun, 2 May 2021 18:57:14 -0400 (EDT)

branch: externals/org
commit 9014577df289322e4eb294ebcf7c7fbfb9d1a414
Author: Jeremie Juste <jeremiejuste@gmail.com>
Commit: Jeremie Juste <jeremiejuste@gmail.com>

    test-ob-R.el: add tests for how NA values are printed
    
    * testing/lisp/test-ob-R.el (ert-deftest test-ob-r/NA-blank): new test
    for :results value. Make sure that NA values in R data.frames are
    empty string instead of nil previously
    
    see https://orgmode.org/list/87pn1dufm2.fsf@gmail.com/
---
 testing/lisp/test-ob-R.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/testing/lisp/test-ob-R.el b/testing/lisp/test-ob-R.el
index 12eac83..c36bac9 100644
--- a/testing/lisp/test-ob-R.el
+++ b/testing/lisp/test-ob-R.el
@@ -142,6 +142,15 @@ log10(10)
 #+end_src"
      (should (string= "[1] 14\n[1] 2.302585\n[1] 1\n[1] 20\n[1] 0.3333333\n[1] 
Inf\n" (org-babel-execute-src-block))))))
 
+(ert-deftest test-ob-r/NA-blank ()
+  "For :results value, NAs should be empty"
+  (let (ess-ask-for-ess-directory ess-history-file)
+    (should (equal '(("A" "B") hline ("" 1) (1 2) (1 "") (1 4) (1 4))
+  (org-test-with-temp-text "#+BEGIN_SRC R :results value :colnames yes
+  data.frame(A=c(NA,1,1,1,1),B=c(1,2,NA,4,4))
+#+end_src"     
+  (org-babel-execute-src-block))))))
+
 (provide 'test-ob-R)
 
 ;;; test-ob-R.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]