Re: [R] Windows List of Folders?

From: Robert Gentleman <rgentlem_at_fhcrc.org>
Date: Sun 01 May 2005 - 02:49:06 EST

Hi,
  We have some documentation of the file handling capabilities, among other things, at
  http://www.bioconductor.org/develPage/develPage.html

comments, improvements etc welcome.

Best wishes,

    Robert
On Apr 29, 2005, at 4:01 PM, Henrik Bengtsson wrote:

> Example:
>
> path <- system.file(package="base")
> pathnames <- list.files(path, full.names=TRUE)
> isDir <- file.info(pathnames)$isdir
> dirs <- pathnames[isDir]
> files <- pathnames[!isDir]
>
> If you don't get the 'isDir' line, think of it as
> infos <- file.info(pathnames)
> isDir <- infos$isdir
>
> /Henrik
>
> khobson@fd9ns01.okladot.state.ok.us wrote:
>> For windows, how can I list only the folders in some folder?
>> I was thinking that dir() and file.info() with isdir==TRUE being
>> something
>> that might work.
>> These folders or directories are numerically named with no dot
>> extension
>> names or other characters. Typically, these are 3132, 3334, ...
>> Here is what I tried. The last line is where I need more work.
>> pData="C:/Myfiles/R/Data/"
>> setwd (pData)
>> x <- dir(pData, all.files=F)
>> y <- file.info(x, x$isdir==T)
>> TIA
>> Kenneth Ray Hobson, P.E.
>> Oklahoma DOT - QA & IAS Manager
>> 200 N.E. 21st Street
>> Oklahoma City, OK 73105-3204
>> ______________________________________________
>> R-help@stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide!
>> http://www.R-project.org/posting-guide.html
>>
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>

+----------------------------------------------------------------------- 
----------------+
| Robert Gentleman              phone: (206) 667-7700                    
          |
| Head, Program in Computational Biology   fax:  (206) 667-1319   |
| Division of Public Health Sciences       office: M2-B865               
       |
| Fred Hutchinson Cancer Research Center                                 
          |
| email: rgentlem@fhcrc.org                                              
                          |
+----------------------------------------------------------------------- 
----------------+

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun May 01 03:02:09 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:31 EST