Re: [R] Directory operations

2010-01-11 Thread Seth Falcon
On 1/10/10 5:46 AM, anupam sinha wrote: Hi Uwe, Thanks for your suggestion . Here's my code. I am confused as to how to initialize an empty list . Here I have used pairlist() *list.files()->org_xml_dirs ## the following is much preferred: org_xml_dirs <- list.files() for

Re: [R] Directory operations

2010-01-11 Thread Don MacQueen
To initialize an list: foo <- list() ## and then extend it as in your code foo <- c(foo, list(x=1)) foo $x [1] 1 foo <- c(foo, list(y=1)) foo $x [1] 1 $y [1] 1 At 7:16 PM +0530 1/10/10, anupam sinha wrote: Hi Uwe, Thanks for your suggestion . Here's my code. I am conf

Re: [R] Directory operations

2010-01-10 Thread anupam sinha
Hi Uwe, Thanks for your suggestion . Here's my code. I am confused as to how to initialize an empty list . Here I have used pairlist() *list.files()->org_xml_dirs for (i in org_xml_dirs) { setwd(file.path("/home/anupam/Research/Anupam_data/ORG_XML_FILES/",i)) org_xml<-list.files(

Re: [R] Directory operations

2010-01-09 Thread Uwe Ligges
On 09.01.2010 19:04, anupam sinha wrote: Hi Jim, Thanks for your suggestion. I tried scripting but gives me an error. Can you tell me what am I doing wrong here ? *> list.files()->org_xml_dirs Please do turn that arrow around for (i in org_xml_dirs){ + setwd("/home/anup

Re: [R] Directory operations

2010-01-09 Thread anupam sinha
Hi Jim, Thanks for your suggestion. I tried scripting but gives me an error. Can you tell me what am I doing wrong here ? *> list.files()->org_xml_dirs > for (i in org_xml_dirs){ + setwd("/home/anupam/Research/Anupam_data/ORG_XML_FILES/i")} Error in setwd("/home/anupam/Research/Anu

Re: [R] Directory operations

2010-01-08 Thread jim holtman
?list.files ?file.info ?setwd You can get a list of all the files in a directory (list.files) and then do a file.info to determine which ones are the directories you want to search. A list.files on that directory will give you the list of file names that you can then process. On Fri, Jan 8, 20

[R] Directory operations

2010-01-08 Thread anupam sinha
Dear all, I have this directory structure : Dir1 Dir2 Dir3 Dir4 . A.xml D.xmlG.xml B.xml E.xml H.xml C.xml F.xml I.xml Within each of these directories (Dir1, Dir2 etc) there are a num of xml files (A.xml, B.xml etc).