Skip to content
Prev 254658 / 398498 Next

extracting file names

On Thu, Mar 24, 2011 at 03:49:32PM +1300, Darcy Webber wrote:
Per ?file.choose, output of file.choose() is "A character vector
of length one giving the file path," so why not do that separately
from the read.table(), such as:

file.name <- file.choose()
dat <- read.table(file.name, header = FALSE)
...
write.table(dat, file = paste(file.name, "_output.DAT", sep = ""))

[Caveat: I haven't actually tried the above.]
Peace,
david