I have a tibble:
library('tibble')
df <- tibble(
ticker = c("first", "second", "third"),
status = c(T,T,T)
)
> df
# A tibble: 3 x 2
ticker status
1 first TRUE
2 second TRUE
3 third TRUE
I want to change the status of 'first' to FALSE in the original df.
But when I run this code:
library('dplyr')
df %<>%
filter(ticker=='first') %>%
mutate(
status = F
)
I get my original df only with the first row
> df
# A tibble: 1 x 2
ticker status
1 first FALSE
Instead of:
> df
# A tibble: 3 x 2
ticker status
1 first FALSE
2 second TRUE
3 third TRUE