Non-CSV Dataset Creation

29 views
Skip to first unread message

mudphone

unread,
Jan 30, 2010, 9:18:15 PM1/30/10
to Incanter
Hi folks,

I have some data which I already have stored as a list of Clojure
maps. Is there a way to create an Incanter data set from this?
Currently, I'm transforming it into CSV files first, then doing a
"read-dataset". Is that the "normal" way of going about it? Or, is
there a short-cut?

Thanks,
Kyle

David Edgar Liebke

unread,
Jan 30, 2010, 9:38:02 PM1/30/10
to inca...@googlegroups.com
Hi Kyle,

The to-dataset function does what you want.

David

mudphone

unread,
Jan 30, 2010, 9:47:46 PM1/30/10
to Incanter
Hi David,

Sorry for bothering you all weekend :) Thanks for that. Awesome. I
was looking for it in incanter.io.

Kyle

David Edgar Liebke

unread,
Jan 30, 2010, 9:56:23 PM1/30/10
to inca...@googlegroups.com
No problem, I'm glad to help.

If you're working with datasets, also checkout the following recently
added functions:
$, $where, $join, $rollup, $order, and $group-by.

I've also made the chart functions dataset aware. You can pass column
names of a given dataset to the functions instead of the actual data
values. For instance,

(view (scatter-plot :Sepal.Length :Sepal.Width :group-by :Species
:data (get-dataset :iris)))


They also support the with-data macro:

(with-data (get-dataset :iris)
(view (scatter-plot :Sepal.Length :Sepal.Width :group-by :Species)))


David

mudphone

unread,
Jan 30, 2010, 10:08:50 PM1/30/10
to Incanter
David,

That is fantastic. I was just looking at the with-data macro and
$where syntax. It's just too cool.

* currently ripping my to-csv parsing code out and replacing with
incanter...
Kyle

Reply all
Reply to author
Forward
0 new messages