Hi All, I am updating my R package that is currently on CRAN.
I am looking to have my main package function iterate through some files in a directory, but am having some issues. In my function, I do the following (I might switch to 'replicate()' instead since non-preallocated for loops can be very slow): file.names <- dir(path, pattern = ".fas") for (i in 1:length(file.names)) { # read in DNA sequences using 'pegas' package seqs <- read.dna(file = file.names[i], format = "fasta") } However, I am uncertain how my function should handle the 'path' argument to dir(). I could provide 'path' as an explicit argument to my function, but is there a less direct way? What I'm after is something like 'file.choose()', except for a folder, rather than a file. Has anyone implemented something similar in their R packages? Thanks! [[alternative HTML version deleted]] ______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel