Using R, I want to check the ManufShortName
column and if there is the word 'BLANK', then I want to return the word 'BLANK' in another column named AnalysisNotesCode
in the same row.
If there is a word currently written in the AnalysisNotesCode
column, I want to overwrite it with 'BLANK'. How do I do this? Thank you!
Basically the same as davearmstrong's comment but using tidyverse.
library(dplyr)
mydata <- mydata |>
mutate(AnalysisNotesCode = if_else(ManufShortName == "BLANK", "BLANK", AnalysisNotesCode)