[R] get absolute file path

Duncan Murdoch murdoch.duncan at gmail.com
Sun Sep 26 10:51:12 CEST 2010


On 26/09/2010 4:08 AM, Romain Francois wrote:
> Le 26/09/10 10:00, Sebastian Gibb a écrit :
>> Hello,
>>
>> I get a value which stores a relative file name. (I get it from another
>> function, which I don't want to change.)
>> e.g.
>>> fileName<- "../data/2010-08.csv";
>> Is it possible to get the absolute file path out of this value?
>> (e.g. /home/sebastian/documents/data/2010-08.csv)
>>
>> Kind regards,
>>
>> Sebastian
> 
> Hi,
> 
> I often use tools:::file_path_as_absolute which is not exported from the 
> tools namespace, but does the job.

Or use normalizePath, exported from utils.

Duncan Murdoch



More information about the R-help mailing list