Created
January 19, 2019 17:31
-
-
Save brfitzpatrick/8b0d8ee673608fb57b475d151f14cfcc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input.seq <- 1:10 | |
for(i in 1:length(input.seq)){ | |
file.con <-file(paste0('script', input.seq[i], '.R')) | |
writeLines( | |
text = c("source('my.fun.R')", | |
paste0('result', i, ' <- my.fun(x = ', i, ", y = 'character input')"), | |
paste0("save(list = 'result", i, "', file = 'result", i, ".RData')") | |
), | |
con = file.con | |
) | |
close(file.con) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment