I have a df of CO2 levels from three different sensors (A1,A2 and A3) but each sensor has a different offset. I would like to subtract the known offset (in a separate vector called offSet) from the data and add 400 to all data points in `df$CO2.ppm`.

```
df<-as.data.frame(Sensor=rep(c("A1","A2","A3"),each=50), CO2.ppm.=sample(400:1000, 150, replace=T))

offSets<-as.data.frame(Sensor=c("A1","A2","A3"),value=c(5,6,10))

```

Something like this makes sense in my mind but I can't quite get the syntax of the last bit right. Any help would be much appreciated, thank you.

```
df %>% 
  group_by(Sensor) %>% 
  mutate(CO2.ppm.OffSet=CO2.ppm.+400-rep(offSets$value,each=offSets) %>%
  group_by(Sensor) %>% 
  summarise(n()))

```