[R] detect filetype (as in unix 'file')

Jeroen Ooms jeroenooms at gmail.com
Mon Apr 4 05:02:19 CEST 2011

Is there a way in R (in Linux) to detect the type of a file without invoking
a shell? E.g to do this:

> system("file density.plot")
density.plot: PDF document, version 1.4

but without using system()? I tried file() and file.info(), but both do
display the information I am looking for.

View this message in context: http://r.789695.n4.nabble.com/detect-filetype-as-in-unix-file-tp3424562p3424562.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list