I am not sure if I understand your reply Nir correctly.
I know that without specifying a path write.table() will save all these files in my currect working directory,
but I want to save them into another disk and in another directory.
I have come up with this solution:
dat2 = c(1:10)
mypath <- "Q:/TXT2/"
for (i in 1:length(dat2)) {
write.table(dat2[i],
file = paste0(mypath, paste(dat2[i], "txt", sep = ".")))
}
which works very well, but I was wondering if there is any tidyverse alternative ?
its best to use file.path rather than a second paste to glue mypath to the rest , as its more cross platform compatible.
You can optionally use tidyverse purrr to do the iteration