I have a variable `i` that maps to a set of categories. 

I wish to set the variable `sector` to the matching category, based on the value of `i`. 

I am able to do this with a series of `if` statements, as follows: 

```
    if(i %in% c(7, 14, 21)) {sector = 'mining'} 
    if(i %in% c(28, 35, 42)) {sector = 'manu'} 
    if(i %in% c(49, 56, 63)) {sector = 'othr'} 
    if(i %in% c(70, 77, 84)) {sector = 'all'} 

```

This seems like the sort of thing for which there ought to be a grouped switch type structure available. Is there such a thing in R? 

Many thanks