R语言,编写一个函数,可以计算,向量里,奇数的个数?

如题所述

第1个回答  2020-04-26
myfun<-function(x){
return(length(x[x%%2==1]))
}
x <- c(1,2,5)
myfun(x)
#2本回答被提问者采纳
相似回答