导致错误的原因是操作员优先

时间:2018-10-29 16:59:50

标签: r

我试图一式三份地取正值的%CV,但是似乎产生合理数值答案的东西打破了dplyr代码,现在我意识到它甚至具有各种怪异的副作用在基数R中。

这是怎么回事?

#why does this seem to give a reasonable numeric answer, then there are errors and unusual things?
testc <- c(0.183662273,0.175215584,-0.16)
sd(testc[testc>0])/mean(testc)*100
sd(testc[testc>0])/mean(testc)*100 %>% as.numeric() %>% str()
sd(testc[testc>0])/mean(testc)*100 %>% as.numeric() %>% class()
sd(testc[testc>0])/mean(testc)*100 %>% str()
sd(testc[testc>0])/mean(testc)*100 %>% class()

0 个答案:

没有答案