Additionally (both for DataFrames and Meta), how could I select columns by type for a summary (e.g. if char would not work woth log und sum).
Basically I am looking for equivalents of TidyRβs summarize_if and summarize_at .
New to Julia, I am happy for any hints beyond the standard documentation.
DataFramesMeta.jl was designed with intention of explicit passing of column names. If you want, you can pass arbitrarily complex expression to it also escaping it with $ (though it is useful only in complex cases - here it is just a noise and probably using combine is better):
@combine(groupby(df, :gr), $(names(df) .=> (x->sum(log.(x))) .=> x -> x * "_logsum" ))
(note that it also shows you that you can pass a function that renames your input columns).
As @pdeffebach commented column selection having a specified type is achieved using the names function.
It seems df-meta and df-macro are exclusive, i.e. one cannot use them together?
Nice of df-meta IMO is that is it not always rowwise, allowing something like x.-mean(x),
while what you describe and the @group_by(iseven(:b)) is nice in df-macro.
If they are currently exclusive, is there a chance to merge them?
You can switch to by column as well in DataFrameMacros, itβs kind of the other way around because I found in my own use, transform style commands use row wise more often.
You cannot merge them really as they make some fundamentally different choices in their implementation, even though the surface syntax is similar (as both just use the DataFrames verbs as macros). I think one of the biggest differences is that everything in DataFrameMacros is automatically broadcast which gives you these multi column operations.