Running a Powershell script from R using system2() rather than system()? -


i have powershell script (say @ c:\directoryname\coolscript.ps1). if want invoke r, can run

system('powershell -file "c:\\directoryname\\coolscript.ps1"') 

if try same system2(), returns no error, script not executed. since documentation system() command says system2() "is recommended new code", use system2(). there way this?

unlike system, system2() command quoted shquote, must single command without arguments.

both of them works :

system("sed -i 's/oldword\\s/oldword/g' d:/junk/x/test.tex") system2("sed", args=c("-i", "s/oldword\\s/newword/g", "d:/junk/x/test.tex")) 

i try :

system2("powershell", args=c("-file", "c:\\directoryname\\coolscript.ps1")) 

another thing should aware of there 2 versions of r executable in r-3.2.1\bin\i386 (32-bit) , r-3.2.1\bin\x64 (64-bit). default first installed on 32-bit versions of windows, both on 64-bit oses. 32 bits version of r invoke 32 bits version of powershell , same 64 bits version careful use set-executionpolicy right one.


Comments

  1. Running A Powershell Script From R Using System2() Rather Than
    System()? - >>>>> Download Now

    >>>>> Download Full

    Running A Powershell Script From R Using System2() Rather Than
    System()? - >>>>> Download LINK

    >>>>> Download Now

    Running A Powershell Script From R Using System2() Rather Than
    System()? - >>>>> Download Full

    >>>>> Download LINK Pz

    ReplyDelete

Post a Comment

Popular posts from this blog

c# - Store DBContext Log in other EF table -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -