incanter

Why does Incanter return number instead of sequence when result is one value?

亡梦爱人 提交于 2019-12-11 10:54:05
问题 I am having an issue that can be reduced to the following problem: When the result of a query is one value, sel / $ returns a number, when it is more than one value, it is a sequence: (with-data (to-dataset [[1 2] [3 4]]) ($ :col-1)) yields (2 4), but (with-data (to-dataset [[1 2]]) ($ :col-1)) yields 2. I would like it to be a sequence at all times, since I want to e. g. apply + to the sequence. I want to avoid checking for the type using (seq?). Any ideas? Is this behaviour of Incanter

How to manipulate legend in Incanter chart

♀尐吖头ヾ 提交于 2019-12-07 10:31:28
问题 I'm trying to include a legend in an Incanter chart, but I'm having some troubles getting what I want: I want to be able to instantiate a chart with no data first (using [] [] as my x y arguments), then add the data points in a separate step. However the only way to add a legend is to specify :legend true after the initial x y points are given in the constructor. Cannot specify :legend true without x y arguments, and I have not found any add-legend function. The legend option captures the

How to manipulate legend in Incanter chart

烂漫一生 提交于 2019-12-05 17:09:25
I'm trying to include a legend in an Incanter chart, but I'm having some troubles getting what I want: I want to be able to instantiate a chart with no data first (using [] [] as my x y arguments), then add the data points in a separate step. However the only way to add a legend is to specify :legend true after the initial x y points are given in the constructor. Cannot specify :legend true without x y arguments, and I have not found any add-legend function. The legend option captures the code I use when adding the chart data, which means if I don't want ugly code to appear in the legend I

Fast vector math in Clojure / Incanter

喜夏-厌秋 提交于 2019-12-03 01:32:40
问题 I'm currently looking into Clojure and Incanter as an alternative to R. (Not that I dislike R, but it just interesting to try out new languages.) I like Incanter and find the syntax appealing, but vectorized operations are quite slow as compared e.g. to R or Python. As an example I wanted to get the first order difference of a vector using Incanter vector operations, Clojure map and R . Below is the code and timing for all versions. As you can see R is clearly faster. Incanter and Clojure:

Fast vector math in Clojure / Incanter

梦想与她 提交于 2019-12-02 14:55:39
I'm currently looking into Clojure and Incanter as an alternative to R. (Not that I dislike R, but it just interesting to try out new languages.) I like Incanter and find the syntax appealing, but vectorized operations are quite slow as compared e.g. to R or Python. As an example I wanted to get the first order difference of a vector using Incanter vector operations, Clojure map and R . Below is the code and timing for all versions. As you can see R is clearly faster. Incanter and Clojure: (use '(incanter core stats)) (def x (doall (sample-normal 1e7))) (time (def y (doall (minus (rest x)