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.
Running A Powershell Script From R Using System2() Rather Than
ReplyDeleteSystem()? - >>>>> 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