scicloj / clojisr

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

variables with hyphens not working in single quotes #83

Closed behrica closed 1 year ago

behrica commented 1 year ago

I have a data frame with columns haven hyphens and it does not work

(ggplot/ggplot  some-data
                  (ggplot/aes
                   :x '(as.factor w-v-c)
                   :y 'accuracy))
behrica commented 1 year ago

how can I quote it properly ?

behrica commented 1 year ago

I discovered it, I need rsymbol

I wanted basically do this:

(def ds (tc/dataset {"abc" [1 2 3]
                     "a-b-c" [4 5 6]}))
(-> ds
    (r.dplyr/mutate  :abc '(+ 1 abc))
    (r.dplyr/mutate  "`a-b-c`" '(+ 1 (rsymbol "a-b-c"))))