Skip to content

Commit

Permalink
cleaned column names from "."
Browse files Browse the repository at this point in the history
  • Loading branch information
behrica committed Feb 9, 2025
1 parent 8a70f50 commit e6ea55d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
unreleased
* cleaned column names from "." in rdatasets

1.1
* added access fn to all datasets from https://vincentarelbundock.github.io/Rdatasets/articles/data.html

Expand Down
6 changes: 5 additions & 1 deletion dev/gen_datasets_ns.clj
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@
(-> csv

(tc/dataset {:key-fn
csk/->kebab-case-keyword})))))
(fn [s]
(-> s
(str/replace
#"\." "-")
csk/->kebab-case-keyword))})))))
(writeln! writer

(format-code
Expand Down
3 changes: 2 additions & 1 deletion src/scicloj/metamorph/ml/rdatasets.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
(str/replace #"\|(\-*)\|(\-*)\|" "")))
(defn doc-url->md [doc]
(clean-R-relevant (.. (FlexmarkHtmlConverter/builder) build (convert (slurp doc)))))
(defn _fetch-dataset [csv] (-> csv (tc/dataset {:key-fn csk/->kebab-case-keyword})))
(defn _fetch-dataset [csv]
(-> csv (tc/dataset {:key-fn (fn [s] (-> s (str/replace #"\." "-") csk/->kebab-case-keyword))})))

(def fetch-dataset (memoize _fetch-dataset))

Expand Down

0 comments on commit e6ea55d

Please sign in to comment.