[R] how to run system command

Sarah Goslee sarah.goslee at gmail.com
Tue Mar 6 14:34:35 CET 2012


Please read the help for system, paying particular attention to the
intern argument.

> e <- system("date", intern=TRUE)
> e
[1] "Tue Mar  6 08:33:48 EST 2012"


Sarah

On Tue, Mar 6, 2012 at 6:56 AM, sagarnikam123 <sagarnikam123 at gmail.com> wrote:
> i run like ,but it giving other than what i expect
> i also want to capture output & print it
>
>> e<-system("date")
>> e
> [1] 127
>
> ----------------------------------------------------------------------------
>> e<-system("dir")
>> e
> [1] 127
>

-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list