# @chain at element level?

**URL:** <https://discourse.julialang.org/t/chain-at-element-level/67906>\
**Category:** General Usage\
**Tags:** vector, piping\
**Created:** [September 9, 2021, 4:19am UTC](https://discourse.julialang.org/t/chain-at-element-level/67906 "2021-09-09T04:19:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lincoln\_Hannah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lincoln_hannah/32/19198_2.png) [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Post date:** [September 9, 2021, 4:19am UTC](https://discourse.julialang.org/t/chain-at-element-level/67906/1 "2021-09-09T04:19:29Z")

</div>

Does `@chain` have (or can it be given) the equivalent of Pipe’s dot pipe `.|> `  
I know you can use transform with ByRow, or vectorise a function within a chain block, but it would be very nice to just drop to element level the way you can with `@pipe`

Example

```julia
df = DataFrame( A=[1,2,3], B=[4,5,6])

#with @pipe
@pipe eachrow(df) .|> 
    begin
        sumAB = _.A + _.B
        diffAB = _.A - _.B
        (; sumAB, diffAB)
    end |> 
    DataFrame

#with @chain
@chain df begin 
    eachrow . #"." indicates pass at element level - like .|>
    begin
        sumAB = _.A + _.B
        diffAB = _.A - _.B
        (; sumAB, diffAB)
    end # no "." so pass at aggregate level, like usual 
    DataFrame
end

```
