saveCalls.Rd
saveCalls
Returns character vector containing all recursive subproblems
saveCalls(filename)
filename | the file you saved in capture.output |
---|
Character vector containing every recursive call
Use this function in conjunction with capture.output and recursiveCalls. Call capture.output where first parameter is calling recursiveCalls on any recursive function and second parameter is the file name you would like to output it to.
capture.output(recursiveCalls(fib,10), file = "output.txt") fibResult <- saveCalls("output.txt") newlist1 <- createList(10) capture.output(recursiveCalls(fib_memoized,10,newlist1), file = "output.txt") memoizedResult <- saveCalls("output.txt")