Q:

R adding values to a column

So what I want to do is add a value to a column depending on the value of another column
+--------------------------+----------------
| ID         |   name      |    value
| 1          |   jim       |      
| 1          |   jim       |      
| 1          |   Ron       |      
| 2          |   jim       |      
| 2          |   Tim       |      
| 1          |   jim       |      

As you can see I have this value column and I want the value to be 0 if the name is jim and 1 if the name is anything else.
+--------------------------+----------------
| ID         |   name      |    value
| 1          |   jim       |      0
| 1          |   jim       |      0
| 1          |   Ron       |      1
| 2          |   jim       |      0
| 2          |   Tim       |      1
| 1          |   jim       |      0

Anything help is appreciated , Thanks

A:

So the answer to this question was to simply do:
df$value <- as.integer(df$name != 'Jim')

