Reshape a clojask dataframe between wide and long layouts.
Reshape a clojask dataframe between wide and long layouts.
(dcast df
output-dir
id
measure-name
value-name
vals
&
{:keys [vals-name] :or {vals-name vals}})Reshape the clojask dataframe from long to wide: the rows that share the id columns collapse into one row with a column per entry of vals, filled from value-name where measure-name matches; missing entries are empty. The operations are appended to df itself.
Reshape the clojask dataframe from long to wide: the rows that share the id columns collapse into one row with a column per entry of vals, filled from value-name where measure-name matches; missing entries are empty. The operations are appended to df itself.
(melt df
output-dir
id
measure
&
{:keys [measure-name value-name]
:or {measure-name "measure" value-name "value"}})Reshape the clojask dataframe from wide to long: every row becomes one row per measure column, holding the id columns, the measure's name and its value.
Reshape the clojask dataframe from wide to long: every row becomes one row per measure column, holding the id columns, the measure's name and its value.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |