Tables 2/3*

Endomorphic functions #2

Adding a column

We can generate values for a new column from existing columns. This again creates a new table with additional column.

spr .add-column "Main Keyword" { Keywords } { .split "," .first .trim }
; returns a new table with additional column

spr .add-column "Fullname" { A B } { A + " " + B }

You can also add colunn using averf

spr .add-column regexp ""

 

Droping a column

Adding columns vs. changing existing ones is I think a clearer strategy, but you could end up with a bunch of columns you don’t want

spr .add-column "Main Keyword" { Keywords } { .split "," .first .trim }
; returns a new table with additional column

spr .add-column "Fullname" { A B } { A + " " + B }

 

Grouping and Aggregates

spr .group-by 'Species_cln { }
; 

 

Joining tables together

; load another

; left join

; inner joun

 

Table as state store

Ref Table

rspr: ref spr

rsps .rename-column 'Adversary "Adversary name"

```lisp
rsps .rename-column 'Adversary "Adversary name"

...

Saving a table

As CSV

spr .save\csv %file.csv

spr .save\xlsc %file.xlsx

spr .to-json\lines %file.lines.json

spr .dump .write* %file.rye


...