R-alpha: R-0.14: bugs in char.expand()

Kurt Hornik (Kurt.Hornik@ci.tuwien.ac.at)
Tue, 10 Dec 1996 18:33:35 +0100


Date: Tue, 10 Dec 1996 18:33:35 +0100
Message-Id: <199612101733.SAA01655@aragorn.ci.tuwien.ac.at>
From: Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at>
To: r-testers@stat.math.ethz.ch
Subject: R-alpha: R-0.14:  bugs in char.expand()

The following patch should make char.expand() work:

*** src/library/base/funs/match.orig	Tue Dec 10 13:53:59 1996
--- src/library/base/funs/match	Tue Dec 10 13:59:57 1996
*************** char.expand <- function(input, target, n
*** 38,46 ****
  {
  	if(length(input) != 1)
  		stop("char.expand: input must have length 1")
! 	if(!(is.character(inputs) && is.character(target)))
  		stop("char.expand: input must be character")
  	y<-.Internal(pmatch(input,target))
  	if(any(is.na(y))) eval(nomatch)
! 	input[y]
  }
--- 38,46 ----
  {
  	if(length(input) != 1)
  		stop("char.expand: input must have length 1")
! 	if(!(is.character(input) && is.character(target)))
  		stop("char.expand: input must be character")
  	y<-.Internal(pmatch(input,target))
  	if(any(is.na(y))) eval(nomatch)
! 	target[y]
  }

-k
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- For info or help, send "info" or "help",
To [un]subscribe, send "[un]subscribe"
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-