Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
for (i in 1:10) print(i) for (i in 1:10) if .... ??
指定奇数的正确表达式是什么?
如果由于某种原因您必须避免使用的一种可能性seq()
seq()
for (i in 1:10) { if (i %% 2 ==1) print(i) } #[1] 1 #[1] 3 #[1] 5 #[1] 7 #[1] 9