This file is indexed.

/usr/lib/R/site-library/foreach/examples/rf.R is in r-cran-foreach 1.4.4-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# a simple parallel random forest

library(foreach)
library(randomForest)

# generate the inputs
nr <- 1000
x <- matrix(runif(100000), nr)
y <- gl(2, nr/2)

# split the total number of trees by the number of parallel execution workers
nw <- getDoParWorkers()
cat(sprintf('Running with %d worker(s)\n', nw))
it <- idiv(1000, chunks=nw)

# run the randomForest jobs, and combine the results
print(system.time({
rf <- foreach(ntree=it, .combine=combine, .multicombine=TRUE,
              .inorder=FALSE, .packages='randomForest') %dopar% {
  randomForest(x, y, ntree=ntree, importance=TRUE)
}
}))

# print the result
print(rf)