[R] how to get no of pdf files in a particular directory

Paul Roebuck roebuck at mdanderson.org
Mon Aug 18 09:32:55 CEST 2008


On Mon, 18 Aug 2008, Kurapati, Ravichandra (Ravichandra) wrote:

> Let's say,
>
> 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.
>

R> pdf.re <- ".*[pP][dD][fF]$"
R> files <- list.files(path=Dir, pattern=pdf.re)
R> length(files)

----------------------------------------------------------
SIGSIG -- signature too long (core dumped)



More information about the R-help mailing list