jeudi 4 mars 2021

Higher/lower than column in R

I have got a data frame with a column called WTP () filled with numbers from 5-30. In this data frame, I now want to add some new columns including price steps by 5 (i.e., buys at 5, buys at 10,..., buys at 30). My target is to fill this columns with a 1 if the WTP is higher than the price and a 0 if the WTP is lower than the price. What kind of function do I need to use to do this?

Thanks in advance!

Aucun commentaire:

Enregistrer un commentaire