List comprehension in R

前端 未结 7 1557
执笔经年
执笔经年 2020-12-24 11:48

Is there a way to implement list comprehension in R?

Like python:

sum([x for x in range(1000) if x % 3== 0 or x % 5== 0])

same in H

7条回答
提交回复
热议问题