[rkward-cvs] rkward/rkward/rbackend/rpackages/rkward/R internal.R,1.23,1.24

Thomas Friedrichsmeier tfry at users.sourceforge.net
Mon Apr 17 12:09:02 UTC 2006


Update of /cvsroot/rkward/rkward/rkward/rbackend/rpackages/rkward/R
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14827/rkward/R

Modified Files:
	internal.R 
Log Message:
More generic version of require

Index: internal.R
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rbackend/rpackages/rkward/R/internal.R,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** internal.R	17 Apr 2006 11:58:40 -0000	1.23
--- internal.R	17 Apr 2006 12:09:00 -0000	1.24
***************
*** 113,135 ****
  }
  
! "require" <- function (package, lib.loc=NULL, quietly = FALSE, warn.conflicts = TRUE, keep.source = getOption("keep.source.pkgs"), character.only = FALSE, version, save = TRUE) {
! 	if (!character.only) {
! 		package <- as.character (substitute (package));
! 	}
! # R 2.2.x does not have a lib.loc parameter! Do some conditional code until nobody uses R 2.2.x anymore
! 	vers <- R.Version ()
! 	vers <- 10 * as.numeric (vers$major) + as.numeric (vers$minor)
! 	if (vers < 23) {
! 		if (!base::require (as.character (package), quietly=quietly, warn.conflicts=warn.conflicts, keep.source=keep.source, character.only=TRUE, version=version, save=save)) {
! 			.rk.do.call ("require", as.character (package))
! 			return (base::require (as.character (package), quietly=quietly, warn.conflicts=warn.conflicts, keep.source=keep.source, character.only=TRUE, version=version, save=save));
! 		}
! 	} else {
! 		if (!base::require (as.character (package), lib.loc=lib.loc, quietly=quietly, warn.conflicts=warn.conflicts, keep.source=keep.source, character.only=TRUE, version=version, save=save)) {
! 			.rk.do.call ("require", as.character (package))
! 			return (base::require (as.character (package), lib.loc=lib.loc, quietly=quietly, warn.conflicts=warn.conflicts, keep.source=keep.source, character.only=TRUE, version=version, save=save));
! 		}
! 	}
! 	return (TRUE)
  }
  
--- 113,128 ----
  }
  
! "require" <- function (package, quietly = FALSE, character.only = FALSE, ...)
! {
!     if (!character.only) {
!         package <- as.character(substitute(package))
!     }
!         if (!base::require(as.character(package), quietly = quietly, 
!             character.only = TRUE, ...)) {
!             .rk.do.call("require", as.character(package))
!             return(base::require(as.character(package), quietly = quietly, 
!                 character.only = TRUE, ...))
!         }
!     return(TRUE)
  }
  





More information about the rkward-tracker mailing list