这是一个友好的警告,提示未正确指定尺寸和数据长度,但如果我们需要取消限制,请使用suppressWarnings()
(虽然不建议)
f <- suppressWarnings(matrix(1:6, nrow=1, ncol=9))
或另一种选择是length.out
从rep
f1 <- matrix(rep(1:6, length.out=9), ncol=9)
identical(f, f1)
#[1] TRUE
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句