[R] R lappy, sapply or mapply question

Frank Schwidom
2015-10-10T14:08:39Z

On 2015-10-09 20:15:16, liqunhan--- via R-help wrote:

> for (k in 1 : 50000) {
> ? xlist <- list(x5 = dailyrecord$a[k], x6 = dailyrecord$e[k], x7 =
dailyrecord$f[k])
> ? result_forloop[k] <- fun3(list1, list2, xlist)
> }

result_forloop <- lapply( 1 : 50000, function( k) {

 tmpRow <- dailyrecord[ k, ]

 xlist <- with( df, list( x5= a, x6= e, x7= f))

 fun3(list1, list2, xlist)

})