2016-08-13 101 views

回答

5

我們可以使用Reduce-

Reduce(`-`, myVect) 
#[1] -8 

或者使用sum

sum(c(myVect[1], -1*myVect[-1])) 
#[1] -8 
+1

感謝那些工作。 – Amit