Hi there. I have a nested dataframe like this:
df<-mpg %>% group_by(manufacturer) %>% nest()
And I have to apply this function to clean some values:
func<-function(drv,cty){
values<-which(drv=="f"& cty<20)
cty[values]<-0
cty}
Only on these manufacturers
manufacturers_vector<-c("audi","chevrolet","jeep")
There is any way I can apply the function only if the manufacturer column in my df matches a value in manufacturers_vector?