On 05/24/2010 05:40 PM, Daisy Englert Duursma wrote:
Dear List,
I am making a list of all the files in a folder and I want to exclude
one file called "proj.current". This is the 31st file in a folder.
Currently I use the command:
tdirs<- list.files(pattern="proj.")[-31]
However I would like to exclude it based on its name and not the position.
Hi Daisy,
I think that:
file_list<-list.files(pattern="proj[.]")
tdirs<-file_list[!as.logical(match(file_list,"proj.current",0))]
should do the trick.
Jim
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.