[rkward-cvs] SF.net SVN: rkward:[4294] trunk/rkward/rkward/rbackend/rpackages/rkward/R

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Aug 30 12:28:56 UTC 2012


Revision: 4294
          http://rkward.svn.sourceforge.net/rkward/?rev=4294&view=rev
Author:   tfry
Date:     2012-08-30 12:28:56 +0000 (Thu, 30 Aug 2012)
Log Message:
-----------
More robust label functions, and fix a small problem in test mode headings.

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rpackages/rkward/R/rk.label-functions.R
    trunk/rkward/rkward/rbackend/rpackages/rkward/R/rk.print-functions.R

Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/R/rk.label-functions.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/rk.label-functions.R	2012-08-25 19:22:34 UTC (rev 4293)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/rk.label-functions.R	2012-08-30 12:28:56 UTC (rev 4294)
@@ -61,8 +61,8 @@
 		x <- eval (x)
 	}
 	ret <- attr (x, ".rk.meta")[["label"]]
-	if (is.null (ret) || is.na (ret)) ""
-	else as.character (as.vector (ret))
+	if (is.null (ret) || is.na (ret) || (length (ret) < 1)) ""
+	else as.character (as.vector (ret))[1L]
 }
 
 # set rkward label
@@ -74,7 +74,7 @@
 	} else {
 		meta <- attr (x, ".rk.meta")
 	}
-	meta[["label"]] <- as.character (label)
+	meta[["label"]] <- as.character (label)[1L]
 	eval(substitute(attr(x, ".rk.meta") <- meta), envir = envir)
 }
 
@@ -140,7 +140,7 @@
 			shortname <- .rk.make.short.name (argnames[i])
 		}
 
-		if (is.null (lbl) || (length (lbl) < 1)) descript[i] <- shortname
+		if (is.null (lbl) || (length (lbl) != 1) || (lbl == "")) descript[i] <- shortname
 		else descript[i] <- paste (shortname, " (", lbl, ")", sep="")
 	}
 

Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/R/rk.print-functions.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/rk.print-functions.R	2012-08-25 19:22:34 UTC (rev 4293)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/rk.print-functions.R	2012-08-30 12:28:56 UTC (rev 4294)
@@ -120,7 +120,7 @@
 			cat("<script type=\"text/javascript\">\n\t<!--\n\t\taddToTOC('",header.id,"','",level,"');\n\t// -->\n</script>\n", sep="")
 		}
 	} else {
-		cat ("<h", level, ">", title, "</a></h", level, ">\n", sep="")
+		cat ("<h", level, ">", title, "</h", level, ">\n", sep="")
 	}
 
 	if (length (parameters)) {

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the rkward-tracker mailing list