How to update values with dplyr

前端 未结 1 1211
孤城傲影
孤城傲影 2020-12-24 11:40

I\'m currently trying to update values from a data.frame using dplyr butI don\'t know if it is possible to replace a subset of values?

# the net4 table
head(         


        
相关标签:
1条回答
  • 2020-12-24 11:52

    Use mutate and ifelse

    mutate(net4,
      ave = ifelse(ave < 10 & ave != temp2, temps2 / NNET * NET, ave)
    )
    
    0 讨论(0)
提交回复
热议问题