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

Henrique Dallazuanna wwwhsd at gmail.com
Mon Aug 18 13:33:50 CEST 2008


Try this:

sapply(c("csv$", "pdf$"), function(x)length(dir(path=Dir, pattern  = x)))

On Mon, Aug 18, 2008 at 4:59 AM, Kurapati, Ravichandra (Ravichandra)
<ravichandra.kurapati at alcatel-lucent.com> wrote:
>> Let's say,
>
>>
>
>> Dir<-"/var/www/html/celnet/users/cxadmin/FlowDuration_DataVolume/fld_0
>
>> 1_
>
>> 08_18_08"
>
>>
>
>> There will be pdf and/or csv files.
>
>> I want to know how many *.pdf and/or csv files are there in that
> directory.
>
>>
>
>> How can I get using R commands.
>
>>
>
>
>
>
>
> Thanks
>
> K.Ravichandra
>
>
>
>
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O



More information about the R-help mailing list