Question

Beginner to R here. I am running a package called plapply (much like lapply) that groups the input list so that the program can run faster for very large data. The program creates temporary files and if plapply runs successfully then it deletes these, but it fails, then it outputs many different .R, .Rdata ,.Rout files into the working directory. This can be fill up the wd very quickly, so I was wondering how I could possibly group these files together into a single folder in the wd when they are outputted. I need something that will work universally and not just on my own computer (meaning I can't use a personal file path). Thanks!

Was it helpful?

Solution

You can use the setwd to set a new working directory. The tempdir function will give you the location of the temporary directory (that will be deleted when that R session ends), you could either use the temporary directory or create a subdirectory within it and use setwd to make that the working directory to hold the files that you do not want to see.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top