## Get the complete factorization of a single number
divisorsRcpp(10^8)
## Or get the complete factorization of many numbers
set.seed(29)
myVec <- sample(-1000000:1000000, 1000)
system.time(myFacs <- divisorsRcpp(myVec))
## Return named list
myFacsWithNames <- divisorsRcpp(myVec, namedList = TRUE)
## Using nThreads
system.time(divisorsRcpp(myVec, nThreads = 2))
Run the code above in your browser using DataLab