Skip to content

Commit

Permalink
Merge pull request #9 from scicloj/toydata-additions-1
Browse files Browse the repository at this point in the history
Toydata additions 1
  • Loading branch information
behrica authored Feb 15, 2024
2 parents 9e4e478 + 7c1eef0 commit f57c40c
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions resources/data/ggplot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
datasets copied from the (MIT-licensed) R ggplot2 package version 3.4.1
Binary file added resources/data/ggplot/diamonds.csv.gz
Binary file not shown.
Binary file added resources/data/ggplot/ecomonics.csv.gz
Binary file not shown.
Binary file added resources/data/ggplot/ecomonics_long.csv.gz
Binary file not shown.
Binary file added resources/data/ggplot/faithfuld.csv.gz
Binary file not shown.
Binary file added resources/data/ggplot/luv_colours.csv.gz
Binary file not shown.
Binary file added resources/data/ggplot/midwest.csv.gz
Binary file not shown.
Binary file added resources/data/ggplot/mpg.csv.gz
Binary file not shown.
Binary file added resources/data/ggplot/msleep.csv.gz
Binary file not shown.
Binary file added resources/data/ggplot/presidential.csv.gz
Binary file not shown.
Binary file added resources/data/ggplot/seals.csv.gz
Binary file not shown.
Binary file added resources/data/ggplot/txhousing.csv.gz
Binary file not shown.
48 changes: 48 additions & 0 deletions src/scicloj/metamorph/ml/toydata/ggplot.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
(ns scicloj.metamorph.ml.toydata.ggplot
(:require [tech.v3.dataset]
[clojure.java.io :as io]))

;; datasets copied from the (MIT-licensed) R ggplot2 package version 3.4.1


(defn- ->resource-dataset [resource-path]
(-> resource-path
io/resource
io/input-stream
(tech.v3.dataset/->dataset
{:file-type :csv
:gzipped? true
:key-fn keyword})))

(def diamonds
(->resource-dataset "data/ggplot/diamonds.csv.gz"))

(def ecomonics
(->resource-dataset "data/ggplot/ecomonics.csv.gz"))

(def ecomonics_long
(->resource-dataset "data/ggplot/ecomonics_long.csv.gz"))

(def faithfuld
(->resource-dataset "data/ggplot/faithfuld.csv.gz"))

(def luv_colours
(->resource-dataset "data/ggplot/luv_colours.csv.gz"))

(def midwest
(->resource-dataset "data/ggplot/midwest.csv.gz"))

(def mpg
(->resource-dataset "data/ggplot/mpg.csv.gz"))

(def msleep
(->resource-dataset "data/ggplot/msleep.csv.gz"))

(def presidential
(->resource-dataset "data/ggplot/presidential.csv.gz"))

(def seals
(->resource-dataset "data/ggplot/seals.csv.gz"))

(def txhousing
(->resource-dataset "data/ggplot/txhousing.csv.gz"))

0 comments on commit f57c40c

Please sign in to comment.