I have a dataset in R in long format. Each ID does not appear the same number of times (i.e. one ID might be one row, another might appear 79 rows). 

e.g.

```
ID      V1       V2    
1       B        0    
1       A        1    
1       C        0   
2       C        0    
3       A        0    
3       C        0

```

I want to create a variable which, if any of the rows for a given ID have `Var2 == 1`, then 1 repeats for every row of that ID

e.g.

```
ID      V1       V2       V3    
1       B        0        1    
1       A        1        1    
1       C        0        1    
2       C        0        0    
3       A        0        0           
3       C        0        0

```