[R] meta characters in file path

Li,Qinghong,ST.LOUIS,Molecular Biology Qinghong.Li at rdmo.nestle.com
Fri Aug 4 17:57:26 CEST 2006


Thanks. I tried them, it works for most of those characters except "*" and "?". 

Does regular expression work in file names in windows? e.g. I have a machine-generated file named "021706 matrix#1479 @50.csv", of which "1479" is kinda random. Will I be able to match "1479" with some sort of "wild card" chars?

Thanks
Johnny

-----Original Message-----
From: Tony Plate [mailto:tplate at acm.org]
Sent: Thursday, August 03, 2006 3:42 PM
To: Li,Qinghong,ST.LOUIS,Molecular Biology
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] meta characters in file path


What is the problem you are having?  Seems to work fine for me running 
under Windows2000:

 > write.table(data.frame(a=1:3,b=4:6), file="@# x.csv", sep=",")
 > read.csv(file="@# x.csv")
   a b
1 1 4
2 2 5
3 3 6
 > sessionInfo()
Version 2.3.1 (2006-06-01)
i386-pc-mingw32

attached base packages:
[1] "methods"   "stats"     "graphics"  "grDevices" "utils"     "datasets"
[7] "base"

other attached packages:
      XML
"0.99-8"
 >

Li,Qinghong,ST.LOUIS,Molecular Biology wrote:
> Hi,
> 
> I need to read in some files. The file names contain come meta characters such as @, #, and white spaces etc, In read.csv, file= option, is there any way that one can make the function to recognize a file path with those characters?
> 
> Thanks
> Johnny
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list