如何找到矢量的所有组合,它在R中是否为负数?
IE
x <- c(1,2,3,4)
将输出
(1,2,3,4), (-1,2,3,4), (1,-2,3,4), (1,2,-3,4), (1,2,3,-4), ... , (-1,-2,-3,-4)
combinations r vector
combinations ×1
r ×1
vector ×1