Anonymous user
Apply a callback to an array: Difference between revisions
m
→{{header|R}}
No edit summary |
m (→{{header|R}}) |
||
Line 1,203:
cubes[i] <- cube(elements[i])
}</lang>
Loop syntax can often simplified using the [http://stat.ethz.ch/R-manual/R-patched/library/base/html/apply.html *
<lang R>elements2 <- list(1,2,3,4,5)
cubes <- sapply(elements2, cube)</lang>
|