SyntaxFix
Write A Post
Hire A Developer
Questions
We can use replace to change the values in 'mpg' to NA that corresponds to cyl==4.
replace
NA
cyl==4
mtcars %>% mutate(mpg=replace(mpg, cyl==4, NA)) %>% as.data.frame()