some problem of dir.create()
1
0
Entering edit mode
cao zongfu ▴ 50
@cao-zongfu-4344
Last seen 9.7 years ago
Dear prof.,Hi When I used dir.create() to creat a directory on Win7, I found the created directory not in my specified path, It always in "C:\Users\123\Documents", and "123" is my username. I want to know how to creat a directory in my specified path on Win7? In addition, I also found that installed packages are in "C:\Users\123\Documents\R\win-library\2.13", not in the R installed path of "C:\Program Files\R\R-2.13.0\library".But it does not affected the normal use of R packages. R session are as follows, > GEO<- "GSM189662" > baseDir= "D:/project/geodownload" > > try(dir.create(GEO)) > storedir <- file.path(baseDir, GEO) > storedir [1] "D:/project/geodownload/GSM189662" I checked the directory GSM189662, it does not in the "D:/project/geodownload/", but in "C:\Users\123\Documents". Would you please help me? Zongfu Cao BeiGene(Beijing), China -- Zongfu Cao *BeiGene(Beijing) Co.,Ltd* No.30 Science Park Road Zhong-Guan-Cun Life Science Park Changping District, Beijing P.R.China Postal Code: 102206 [[alternative HTML version deleted]]
• 798 views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 13 days ago
United States
On 07/09/2011 04:49 PM, cao zongfu wrote: > Dear prof.,Hi > When I used dir.create() to creat a directory on Win7, I found the > created directory not in my specified path, It always in > "C:\Users\123\Documents", and "123" is my username. I want to know how to > creat a directory in my specified path on Win7? > In addition, I also found that installed packages are in > "C:\Users\123\Documents\R\win-library\2.13", not in the R installed path of > "C:\Program Files\R\R-2.13.0\library".But it does not affected the normal > use of R packages. > > R session are as follows, > >> GEO<- "GSM189662" >> baseDir= "D:/project/geodownload" >> >> try(dir.create(GEO)) >> storedir<- file.path(baseDir, GEO) >> storedir > [1] "D:/project/geodownload/GSM189662" dir.create(storedir) Martin > I checked the directory GSM189662, it does not in > the "D:/project/geodownload/", but in "C:\Users\123\Documents". Would you > please help me? > > Zongfu Cao > BeiGene(Beijing), China > > > > -- Computational Biology Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: M1-B861 Telephone: 206 667-2793
ADD COMMENT
0
Entering edit mode
Also, file.path() does not make sure in any way that the path actually exists on your system. Essentially it is equivalent to paste(baseDir, GEO, sep = "/") You could f.eks. try file.exists(file.path(baseDir, GEO)) As Martin said: your problem is that when you create the directory (by using dir.create()) you do not give it the full path name. Kasper On Sun, Jul 10, 2011 at 6:13 AM, Martin Morgan <mtmorgan at="" fhcrc.org=""> wrote: > On 07/09/2011 04:49 PM, cao zongfu wrote: >> >> Dear prof.,Hi >> ? ? ? When I used dir.create() to creat a directory on Win7, I found the >> created directory not in my specified path, It always in >> "C:\Users\123\Documents", and "123" is my username. I want to know how to >> creat a directory in my specified path on Win7? >> ? ? ? In addition, I also found that installed packages are in >> "C:\Users\123\Documents\R\win-library\2.13", not in the R installed path >> of >> "C:\Program Files\R\R-2.13.0\library".But it does not ?affected the normal >> use of R packages. >> >> R session are as follows, >> >>> GEO<- "GSM189662" >>> baseDir= "D:/project/geodownload" >>> >>> try(dir.create(GEO)) >>> storedir<- file.path(baseDir, GEO) >>> storedir >> >> [1] "D:/project/geodownload/GSM189662" > > dir.create(storedir) > > Martin > >> I checked the directory GSM189662, it does not in >> the ?"D:/project/geodownload/", but in "C:\Users\123\Documents". Would you >> please help me? >> >> Zongfu Cao >> BeiGene(Beijing), China >> >> >> >> > > > -- > Computational Biology > Fred Hutchinson Cancer Research Center > 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 > > Location: M1-B861 > Telephone: 206 667-2793 > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor >
ADD REPLY

Login before adding your answer.

Traffic: 583 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6