Background –
For DataFrames, I’d like an easy way to do row-level operations, and use the column names as variable names and have any created variables added automatically as new columns.
in this discussing a nice method was suggested
but it requires writing a function where you have to specify the column names as inputs and outputs.
function f(; a, b, ... )
c = a + b
d = a - b
(; a, b, c, d)
end
D = DataFrame( a=[1,2], b=[3.4) )
@chain D begin
transform( AsTable(:) => ByRow(x->f(x...)) => AsTable )
end
I’d like to avoid re-specifying the column names at all. Something like:
@chain D begin
***drop to row level**** begin
c = a + b
d = a - b
end
end