Questions tagged [system2]

Base R function system2 is the recommended way of invoking an operating system command from within R. It is portable across operating systems. Note that system2() never returns anything, to capture the OS command output in a character variable in the R session, arguments stdout or stderr must be set to TRUE.

35 questions
0
votes
0 answers

R system2 syntax in linux

My problem is with system2 syntax. I am trying to rename filenameA to filenameB in linux. but I need to use full qualified paths, and rename does not like this, so I propose to use "mv". I plan use system2 and "mv" (eventually with map) to march…
user2292410
  • 447
  • 4
  • 13
0
votes
0 answers

executing command line commands in R

I'm trying to execute some linux commands from an R script. I am using R version 3.3.1 and system and system2 are not available for this version. is there any other solution to this?
0
votes
1 answer

system2 functioning in R

When I run a batch file through system2 in R: The following runs the batch file without any issue: system2("Run.bat") However, this one gives an error: system2("Run", stdout=stdout, stderr=stderr) Warning message: running command '"Run.bat"' had…
user308827
  • 21,227
  • 87
  • 254
  • 417
-1
votes
1 answer

system2("bash", "ls") -> cannot execute binary file

Anyone got an idea why system2("bash", "ls") would result in (both in R-Gui and RStudio Console) /usr/bin/ls: /usr/bin/ls: cannot execute binary file while other shells work w/o issues (see example below) and the "bash" in the RStudio Terminal…
GWD
  • 1,387
  • 10
  • 22
-1
votes
1 answer

R purrr system2 map

I have a vector of filenames A and I have an equivalent vector of new names for those files -- B. I was hoping to do: test <-map2(A, B, ~system2('mv', args=c(.x, .y))) or perhaps test <-map2(A, B, ~system2('mv', args=paste(.x, .y))) but .x and .y…
user2292410
  • 447
  • 4
  • 13
1 2
3