[R] how to run system command

Sarah Goslee sarah.goslee at gmail.com
Tue Mar 6 19:09:45 CET 2012

On Tue, Mar 6, 2012 at 8:48 AM, sagarnikam123 <sagarnikam123 at gmail.com> wrote:
> i used it on windows system, but giving error like
>> e <- system("date", intern=TRUE)
> Error in system("date", intern = TRUE) : 'date' not found

If you type date at a windows command line does it work?

You can't use system() to run system commands that don't
exist on your system. I don't run windows, and have no
idea what the command/syntax to obtain the date might be.

It was already suggested you use Sys.Date() instead, and
only use system() for system commands not duplicated in R.


Sarah Goslee

More information about the R-help mailing list