Divide all columns by a chosen column using mutate_all

后端 未结 2 2189
我在风中等你
我在风中等你 2020-12-20 18:47

I have a sample data frame that looks like this (my full dataframe has \"d\" plus 57 elements):

d <- seq(0, 100, 0.5) 
Fe <- runif(201, min = 0, max =          


        
2条回答
  •  甜味超标
    2020-12-20 18:57

    UPDATE to answer by @arg0naut91 (dplyr 1.0.0)

    Example_Ratio <- example %>% 
      mutate(across(everything()), . / Zr) %>% 
      select(Ratio_Elements)
    

提交回复
热议问题