I am attempting to create a flag variable called Profit.flag that indicates whether a specific column in my dataset is profitable (>= 0) or not (<0). This is currently what I have but I am getting an error. Any help would be much obliged!
Profit = data.frame(S2$Profit)
Profit.flag=numeric(474)
for(i in Profit)
{if (Profit[i] >= 0)
{Profit.flag[i] == 1}
else Profit.flag[i] == 0}