6.2.7.1 Simple Example of Using the ore.indexApply Function

The example invokes ore.indexApply and specifies that it execute the input function five times in parallel.

Example 6-16 Using the ore.indexApply Function

This example displays the class of the result, which is ore.list, and then displays the result.

res <- ore.indexApply(5,
      function(index) {
        paste("IndexApply:", index)
      },
      parallel = TRUE)
class(res)
res

Listing for This Example

R> res <- ore.indexApply(5,
+       function(index) {
+         paste("IndexApply:", index)
+       },
+       parallel = TRUE)
R> class(res)
[1] "ore.list"
attr(,"package")
[1] "OREembed"
R> res
$`1`
[1] "IndexApply: 1"
 
$`2`
[1] "IndexApply: 2"
 
$`3`
[1] "IndexApply: 3"
 
$`4`
[1] "IndexApply: 4"
 
$`5`
[1] "IndexApply: 5"