>>> [(x*y) for (x,y) in zip(range(3), (1,11,111))]
[0, 11, 222]
不要这样做
> data.frame(0:2,c(1,11,111))
X0.2 c.1..11..111.
1 0 1
2 1 11
3 2 111
> data.frame(0:2,c(1,11,111))->a
> a[1]*a[2]
X0.2
1 0
2 11
3 222
但是类似这样的东西。
lapply(a, function(x)
{ ...how can I access here the parameters of x?
(not using x[1] or x[2])
}