[rkward-cvs] SF.net SVN: rkward: [865] trunk/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Oct 12 19:35:37 UTC 2006


Revision: 865
          http://svn.sourceforge.net/rkward/?rev=865&view=rev
Author:   tfry
Date:     2006-10-12 12:35:28 -0700 (Thu, 12 Oct 2006)

Log Message:
-----------
Add function to convert pre 0.4.0 meta data

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/rkward/rbackend/rpackages/rkward/R/public.R

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2006-10-12 16:13:53 UTC (rev 864)
+++ trunk/rkward/ChangeLog	2006-10-12 19:35:28 UTC (rev 865)
@@ -1,3 +1,5 @@
+- many new distribution plugins
+- all distribution plugins now use a free-text field, allowing you to enter a vector of probabilties / quantiles
 - another fix to cancelling during readline () calls
 - invalid values are stored in a separate attribute instead of changing the storage mode back and forth -> TODO
 - storage mode for RKWard meta data was changed -> TODO

Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/R/public.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/public.R	2006-10-12 16:13:53 UTC (rev 864)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/public.R	2006-10-12 19:35:28 UTC (rev 865)
@@ -161,3 +161,32 @@
 	ret <- sprintf ("%s)", ret)
 	ret
 }
+
+# utility to convert the rkward meta data of objects created in rkward < 0.4.0
+# keep for a few months after 0.4.0 is out
+"rk.convert.pre040" <- function (x) {
+	if (missing (x)) {
+		x <- list ()
+		lst <- ls (all.names=TRUE, envir=globalenv ())
+		for (childname in lst) {
+	        	assign (childname, rk.convert.pre040 (get (childname, envir = globalenv ())), envir=globalenv ())
+		}
+		return (invisible ())
+	}
+
+	if (is.list (x)) {
+		oa <- attributes (x)
+		x <- lapply (x, function (X) rk.convert.pre040 (X))
+		attributes (x) <- oa
+	}
+
+	a <- attr (x, ".rk.meta")
+	if (is.null (a)) return (x)
+	if (!is.data.frame (a)) return (x)
+	if (length (a) < 1) return (x)
+	an <- as.character (a[[1]])
+	names (an) <- row.names (a)
+	attr (x, ".rk.meta") <- an
+
+	x
+}


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