# Question about @rtransform?

**URL:** https://discourse.julialang.org/t/question-about-rtransform/83815
**Category:** General Usage
**Created:** [July 6, 2022, 2:57am UTC](https://discourse.julialang.org/t/question-about-rtransform/83815 "2022-07-06T02:57:59Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Raymond](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raymond/32/36557_2.png) [@Raymond](https://discourse.julialang.org/u/Raymond)
#### Post date: [July 6, 2022, 2:57am UTC](https://discourse.julialang.org/t/question-about-rtransform/83815/1 "2022-07-06T02:57:59Z")

</div>

Why doesn’t this code work?

```julia
julia> df
4×3 DataFrame
 Row │ y x1 x2
     │ Int64 Int64 Int64
─────┼─────────────────────
   1 │ 2 -97 -999
   2 │ 6 2 3
   3 │ 3 5 -999
   4 │ 5 -97 0

julia> @rtransform df $([:x1, :x2] .=> (x -> x ∈ [-97, -999] ? missing : x) .=> [:x1, :x2])
4×3 DataFrame
 Row │ y x1 x2
     │ Int64 Int64 Int64
─────┼─────────────────────
   1 │ 2 -97 -999
   2 │ 6 2 3
   3 │ 3 5 -999
   4 │ 5 -97 0

```

what I want is

```julia
 Row │ y x1 x2
     │ Int64 Int64? Int64?
─────┼─────────────────────────
   1 │ 2 missing missing
   2 │ 6 2 3
   3 │ 3 5 missing
   4 │ 5 missing 0

```

---

<div class="post-metadata">

### Author: ![Raymond](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raymond/32/36557_2.png) [@Raymond](https://discourse.julialang.org/u/Raymond)
#### Post date: [July 6, 2022, 2:59am UTC](https://discourse.julialang.org/t/question-about-rtransform/83815/2 "2022-07-06T02:59:26Z")

</div>

`@transform` works, why does not `@rtransform` work?

```julia
@transform df $([:x1, :x2] .=> ByRow(x -> x ∈ [-97, -999] ? missing : x) .=> [:x1, :x2])
4×3 DataFrame
 Row │ y x1 x2
     │ Int64 Int64? Int64?
─────┼─────────────────────────
   1 │ 2 missing missing
   2 │ 6 2 3
   3 │ 3 5 missing
   4 │ 5 missing 0

```
