scicloj / clojisr

Clojure speaks statistics - a bridge between Clojure to R
https://scicloj.github.io/clojisr/
Eclipse Public License 2.0
147 stars 9 forks source link

RObject as map value is not translated to R #26

Closed genmeblog closed 4 years ago

genmeblog commented 4 years ago
(clj->r (base/list [1 2 3]))
;; => [[1]]
;; [1] 1 2 3
(clj->r {:a 1 :b (base/list [1 2 3])})
;; ERROR (ClassCastException)
(clj->r {:a 1 :b (r->clj (base/list [1 2 3]))})
;; => $a
;; [1] 1
;;
;; $b
;; $b[[1]]
;; [1] 1 2 3
genmeblog commented 4 years ago

Maybe example here is bad, but the key is to use RObjects or symbols in maps/lists. Currently some elements are constructed using strings (like function or formula) the rest go through REXP and this causes the problem.

genmeblog commented 4 years ago

Partially done in BETA9-SNAPSHOT, small maps (up to 50 elements) are fully supported now.