Skip to content

Commit cf8ab09

Browse files
authored
Merge pull request #251 from ClojureCivitas/aog-5
AoG in Clojure wip
2 parents 65101fa + 05c4331 commit cf8ab09

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/data_visualization/aog_in_clojure_part1.clj

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2845,11 +2845,22 @@ iris
28452845
;; regressions for each (species × island) combination.
28462846

28472847
(facet (=* (data penguins)
2848-
(mapping :bill-length-mm :bill-depth-mm {:color :species})
2848+
(mapping :bill-length-mm
2849+
:bill-depth-mm
2850+
{:color :species})
28492851
(=+ (scatter {:alpha 0.5})
28502852
(linear)))
28512853
{:col :island})
28522854

2855+
;; equivalently:
2856+
(-> (data penguins)
2857+
(mapping :bill-length-mm
2858+
:bill-depth-mm
2859+
{:color :species})
2860+
(=+ (scatter {:alpha 0.5})
2861+
(linear))
2862+
(facet {:col :island}))
2863+
28532864
(kind/test-last [#(and (= (count %) 2)
28542865
(= (:=col (first %)) :island)
28552866
(= (:=color (first %)) :species))])

0 commit comments

Comments
 (0)