[Sciviews-commits] r301 - pkg/svMisc/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Sep 10 17:03:50 CEST 2010


Author: phgrosjean
Date: 2010-09-10 17:03:50 +0200 (Fri, 10 Sep 2010)
New Revision: 301

Added:
   pkg/svMisc/R/callTip.R
Log:
New version of callTip()

Added: pkg/svMisc/R/callTip.R
===================================================================
--- pkg/svMisc/R/callTip.R	                        (rev 0)
+++ pkg/svMisc/R/callTip.R	2010-09-10 15:03:50 UTC (rev 301)
@@ -0,0 +1,23 @@
+CallTip <- function (code, only.args = FALSE, location = FALSE) {
+	.Deprecated("callTip")
+	return(callTip(code, only.args = only.args, location = location))
+}
+
+callTip <- function (code, only.args = FALSE, location = FALSE)
+{
+	code <- attr(completion(code, types = NA, describe = FALSE), "fguess")
+	if (is.null(code) || !length(code) || code == "")
+		return("")
+
+	## Get the corresponding calltip
+	ctip <- argsTip(code, only.args = only.args)
+	if (is.null(ctip)) return("")
+	## Do we need to append an indication of where this function is located?
+	if (isTRUE(location)) {
+ 		where <- res <- eval(parse(text = paste("getAnywhere(", code, ")",
+			sep = "")))$where[1]
+		if (!is.na(where) && where != ".GlobalEnv")
+			ctip <- paste(ctip, " [", sub("^package:", "", where), "]", sep = "")
+	}
+	return(ctip)
+}


Property changes on: pkg/svMisc/R/callTip.R
___________________________________________________________________
Added: svn:executable
   + *



More information about the Sciviews-commits mailing list