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

From: Jeroen Ooms <jeroenooms_at_gmail.com>
Date: Sun, 03 Apr 2011 22:02:19 -0500 (CDT)

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.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 04 Apr 2011 - 04:26:40 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 04 Apr 2011 - 06:40:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive