Description Usage Arguments Details Value Author(s) Examples
Create a temporary file that contains the function definition of the argument so that this file can be sourced to re-instantiate the function.
1 | tempcodefile(fcts)
|
fcts |
Create a temporary file that contains the function definition of the argument so that this file can be sourced to re-instantiate the function. The temporary file is written to the temporary folder of the current R session.
Returns the path to the file written.
Stefan Böhringer <r-packages@s-boehringer.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 | # code to be parallelized
parallel8 = function(e) log(1:e) %*% log(1:e);
parallel2 = function(e) rep(e, e) %*% 1:e * 1:e;
parallel1 = function(e) Lapply(rep(e, 15), parallel2);
parallel0 = function() {
r = sapply(Lapply(1:50, parallel1),
function(e)sum(as.vector(unlist(e))));
r0 = Lapply(1:49, parallel8);
r
}
codeFile = tempcodefile(c(parallel0, parallel1, parallel2, parallel8));
cat(readFile(codeFile));
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.