5

I have no idea how to do this. i have a list of filepath in a column. Now i want to check if at all the filepath is absolute path or not based on both windows or Linux system.

Ex-

somefunction("C:\eclipse-standard-kepler-SR1-win32\eclipse")
ANS: absolutepath or T 
Koushik Saha
  • 673
  • 1
  • 10
  • 25

1 Answers1

7

The package R.utils has a isAbsolutePath and getAbsolutePath function.

tmastny
  • 417
  • 6
  • 11
Justin
  • 42,475
  • 9
  • 93
  • 111
  • Well i am not getting anything here..is shows > ?getAbsolutePath No documentation for ‘getAbsolutePath’ in specified packages and libraries: you could try ‘??getAbsolutePath’ > ?isAbsolutePath No documentation for ‘isAbsolutePath’ in specified packages and libraries: you could try ‘??isAbsolutePath’ – Koushik Saha Jan 20 '14 at 17:47
  • Did you install `R.utils` and then load it using `library(R.utils)`? – Justin Jan 20 '14 at 17:54
  • sorry i thought it is the default utils folder u r talking about. and is the isAbsolutePath works for both windows and Linux based path Names? – Koushik Saha Jan 20 '14 at 18:08
  • You're welcome to confirm this, as I don't have machines of all breeds at my disposal, but I believe that is the intent. – Justin Jan 20 '14 at 18:19
  • I'll keep you posted. give me some time. – Koushik Saha Jan 20 '14 at 18:22
  • 1
    I find it interesting that `isAbsolutePath("/tmp")` gives `TRUE` on Windows, but it really looks and behaves like a relative path! – Remko Duursma Jan 20 '14 at 22:40