https://github.com/cran/Hmisc
Revision b085b63b76054b3bb5c5ada6445e04b4cbd18e12 authored by Charles Dupont on 15 September 2005, 00:00:00 UTC, committed by Gabor Csardi on 15 September 2005, 00:00:00 UTC
1 parent ef5a4e5
Raw File
Tip revision: b085b63b76054b3bb5c5ada6445e04b4cbd18e12 authored by Charles Dupont on 15 September 2005, 00:00:00 UTC
version 3.0-8
Tip revision: b085b63
src.s
##Function to source(x) if x is given, or source(last x given) otherwise
##Last x is stored in options() last.source.   x is unquoted with .s omitted.
##Author: Frank Harrell  19May91

src <- function(x) {
  if(!missing(x)) {
    y <- paste(as.character(substitute(x)),".s",sep="")
    options(last.source=y, TEMPORARY=FALSE)
  }
  else y <- options()$last.source

  if(is.null(y))
    stop("src not called with file name earlier")

  source(y)
  cat(y, "loaded\n")
  invisible()
}
back to top