[R] system() and R 1.7

Duncan Murdoch dmurdoch at pair.com
Sat Apr 19 18:07:16 CEST 2003


On Fri, 18 Apr 2003 11:04:48 -0700, you wrote:

>I am using the system(command, input=a character vector) command on a
>Windows NT machine and I now get the following warning with R 1.7:
>
>Warning message: 
>the condition has length > 1 and only the first element will be used in: if
>(input != "") { 
>

This is a bug, fixed in the current patch version.  To fix your own,
you could edit the file library/base/R/base, as follows:

27878c27879
< system <- function(command, intern = FALSE, wait = TRUE, input = "",
---
> system <- function(command, intern = FALSE, wait = TRUE, input = NULL,
27883c27884
<     if (input!="") {
---
>     if (!is.null(input)) {

The top lines are the released version, the lower lines are the patch.

Duncan Murdoch



More information about the R-help mailing list