1 Constructing data-frames
These are constructors for data-frames that may be more ergonomic than make-data-frame. Generally, while doing data analysis, you want to use df-read/csv or a similar function to read in real-world data from some source. If you are constructing data from a Racket program, however, these may be useful.
syntax
(column-df [column-name column-data] ...)
column-name : (or/c identifier? string?)
column-data : vector?
column-name can either be an identifier or an expression that evaluates to a string. If it is an identifier, it will be taken literally.
> (show (column-df [x (vector 1 2 3)] [(string-append "a" "b") (vector "a" "b" "c")]))
data-frame: 3 rows x 2 columns
┌─┬──┐
│x│ab│
├─┼──┤
│1│a │
├─┼──┤
│2│b │
├─┼──┤
│3│c │
└─┴──┘
syntax
(row-df [column-name ...] value ...)
This method runs in quadratic time, but it is executed solely at compile time, so its performance should be roughly equivalent to that of column-df.