2008/8/18 Kurapati, Ravichandra (Ravichandra)
<[EMAIL PROTECTED]>:
> Dir<-"/var/www/html/celnet/users/cxadmin/FlowDuration_DataVolume/fld_01_
> 08_18_08"
>
> There will be pdf and/or csv files.
>
> I want to know how many *.pdf files are there in that
> directory.
> How can I get using R commands.
>
length(list.files(Dir,pattern="\\.pdf$"))
Note that pattern is a regexp matching .pdf at the end of a string,
not a glob ("*.pdf").
You could use Sys.glob, but list.files looks easier.
Barry
______________________________________________
[email protected] 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.