I would like to replace NA in a particular column with values from another column in same dataframe
DF1:
Item From Price Discount NewPrice
A Delhi 100 .10 110
A Mumbai 200 .10 120
A Pune 150 NA NA
A Nagpur 200 .10 NA
I would like to replace NA in NewPrice with the values in column Price
I have referred this but it is not helping Replace empty values with value from other column in a dataframe
Have tried below one but not working
df$NewPrice <- ifelse(df$NewPrice == "", df$Price, df$NewPrice)