How to add a new column in a existing data in R?



I have created a new variable in R for data preprocessing to extract more information from the existing data.

HighSodium= USDA$Sodium > mean(USDA$Sodium,na.rm=TRUE)

I want to know how I can add a new variable (HighSodium) to the existing data (USDA).So that I can perform remaining preprocessing techniques to the new variable also.


hello @sid100158,

USDA$HighSodium <- HighSodium.:slight_smile:
Hope this helps!!