Skip to content

Instantly share code, notes, and snippets.

Created October 13, 2013 05:17
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
$join does not work if the 1st element in the second dataset does not have a corresponding element in the first dataset
(ns experiment.incanter
(:require [incanter.core :as i]))
(def join-dataset-1 (i/dataset [:id :vehicle-type]
[[1 "car"]
[2 "motor-bike"]
[3 "train"]]))
;;;(i/view join-dataset-1)
(def join-dataset-2 (i/dataset [:id :number-wheels]
[[1 4]
[2 2]
[3 "many"]]))
;;;(i/view join-dataset-2)
;;; (->> (i/$join [:id :id] join-dataset-2 join-dataset-1) i/view)
(def join-dataset-3 (i/dataset [:id :number-wheels]
[;;[1 4]
[2 2]
[3 "many"]]))
;;;(i/view join-dataset-3)
;;(->> (i/$join [:id :id] join-dataset-3 join-dataset-1) i/view)
(def join-dataset-4 (i/dataset [:id :number-wheels]
[[1 4]
;;[2 2]
[3 "many"]]))
;;;(i/view join-dataset-4)
;;(->> (i/$join [:id :id] join-dataset-4 join-dataset-1) i/view)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment