How to access the output from Chain.jl?

Hi,

Discovering Julia and loving it.
I started to dabble with the piping method with Dataframes but can’t get the output as a variable.

for example, how do I get the updated df returned in this case?

@chain df begin 
    by(_, [:a1], nrow)
    rename!(_, :x1 => :count)
end

Thanks!

Just do

new_df = @chain df begin 
    by(_, [:a1], nrow)
    rename!(_, :x1 => :count)
end
2 Likes

Thanks!