简体   繁体   English

tidyverse按行除法使用管道求和

[英]tidyverse divide by rowSums using pipe

I want to do df/rowSums(df) in tidyverse. 我想在tidyverse中做df/rowSums(df)

I tried df %>% ./rowSums(.) but this does not work. 我尝试了df %>% ./rowSums(.)但这不起作用。

Do you have ideas? 你有想法吗? Thanks so much! 非常感谢!

We can wrap it inside the {} 我们可以将其包装在{}

library(dplyr)
df %>%
   {./rowSums(.)}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM