I'll start by just explaining why this didn't work!
A pipe puts the left hand side into the first argument of the function on the right hand side. if_else() doesn't take a dataframe as an argument.
Address == NA literally means "is the adress equal to NA", which is, a), not what you want and, b), never appropriate anyway as to detect NA values you'd use is.na().
The correct syntax looks like this:
library(tidyverse)
df = read_table("REGION MANAGER STATUS Address
Igor Closed Smith St
Helena Open Peters St
Igor Closed Elver St
Helena Open Brownburg St
Igor Open Edel St")
df %>%
mutate(Address = if_else(MANAGER == "Closed", NA_character_, Address))
#> # A tibble: 5 x 4
#> REGION MANAGER STATUS Address
#> <chr> <chr> <chr> <chr>
#> 1 Igor Closed Smith <NA>
#> 2 Helena Open Peters St
#> 3 Igor Closed Elver <NA>
#> 4 Helena Open Brownburg St
#> 5 Igor Open Edel St
We are changing columns, so we use mutate().
The "Address" column is equal to the if_else() call.
Our condition is "is the MANAGER column equal to 'closed'?"
If TRUE, replace with NA_character_ (as it is a character column)
If FALSE, replace with itself (i.e., don't change it)