This is probably a stupid question, but I can't find an answer to it.
My data frame looks like this:
           FISV.Volume FISV.Adjusted FISV.Volume.1
2007-01-03     8545600       12.8925       7635600
2007-01-04     7635600       13.1650       4457200
2007-01-05     4457200       13.1150       3542000
2007-01-08     3542000       13.1475       3908800
2007-01-09     3908800       13.1875       3450800
2007-01-10     3450800       13.1525       3166800
And my code looks like this:
outcomeSymbol <- "FISV.Volume" 
 
nasdaq100["outcome"] <- ifelse(nasdaq100[,paste0(outcomeSymbol,".1")] > nasdaq100[outcomeSymbol],1,0)
           FISV.Volume FISV.Adjusted FISV.Volume.1 FISV.Volume
2007-01-03     8545600       12.8925       7635600           0
2007-01-04     7635600       13.1650       4457200           0
2007-01-05     4457200       13.1150       3542000           0
2007-01-08     3542000       13.1475       3908800           1
2007-01-09     3908800       13.1875       3450800           0
2007-01-10     3450800       13.1525       3166800           0
Now the last column should be called "outcome" and not "FISV.Volume" (I get the same result when I use $ when specifying the name of the new column)
Full code here: http://amunategui.github.io/wallstreet/
 
     
    