frame/reshape
src/frame/reshape.tur
defn
melt
(melt [f :int id-names :int var-name :cstr value-name :cstr] :int)
pivot a wide frame to long format.
Parameters
| f | :int source frame | |
| id-names | cons list of :cstr id-column names (stay as-is, replicated) | |
| var-name | :cstr name of the output column holding original column names | |
| value-name | :cstr name of the output column holding cell values |
Returns
:int frame with (n_orig_rows * n_non_id_cols) rows and (n_id + 2) columns: id columns, then var-name (utf8), then value-name. Non-id columns must share a single type tag; returns 0 otherwise.
Since: FR7
Internal definitions
__rh-nil__rh-cons__rh-list-has-cstr?__rh-list-length__rh-list-nth-int__rh-clone-field-at__rh-non-id-ixs__rh-id-ixs__rh-append-cell__rh-build-id-col__rh-mod__rh-mul__rh-div__rh-build-var-col__rh-build-val-col__rh-common-type__rh-build-id-fields__rh-build-id-cols__rh-list-concat