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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Dec 19 11:37:58 UTC 2007


Revision: 2284
          http://rkward.svn.sourceforge.net/rkward/?rev=2284&view=rev
Author:   tfry
Date:     2007-12-19 03:37:58 -0800 (Wed, 19 Dec 2007)

Log Message:
-----------
Fixes to SPSS import plugin as pointed out by fsando (thanks\!).
Also a slight simplification (final name is only needed in the assignment to globalenv(), not before)

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/rkward/plugins/00saveload/import/import_spss.php

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2007-12-18 23:51:46 UTC (rev 2283)
+++ trunk/rkward/ChangeLog	2007-12-19 11:37:58 UTC (rev 2284)
@@ -1,5 +1,7 @@
 --- Version 0.4.9 - Xxx-XX-XXXX
 
+- Fixed: use.value.labels option was wrong in SPSS import plugin
+- Fixed: SPSS tables would only be imported to the workspace, when the edit option was checked
 - Fixed: correct installation of rkward.desktop file
 - Use the KDE default fixed spacing font for command log and object viewer
 

Modified: trunk/rkward/rkward/plugins/00saveload/import/import_spss.php
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_spss.php	2007-12-18 23:51:46 UTC (rev 2283)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_spss.php	2007-12-19 11:37:58 UTC (rev 2284)
@@ -25,14 +25,15 @@
 	}
 
 	if (getRK_val ("use_labels")) {
-		$labels_opt = ", use.value.labels=TRUE";
 		$labels_opt .= ", max.value.labels=" . getRK_val ("labels_limit");
 		if (getRK_val ("trim_labels")) $labels_opt .= ", trim.factor.names=TRUE";
-	}
+	} else {
+		$labels_opt = ", use.value.labels=FALSE";
+        }
 
 	$object = getRK_val ("saveto");
 ?>
-<? echo ($object); ?> <- read.spss ("<? getRK ("file"); ?>"<? echo ($data_frame_opt); echo ($labels_opt); ?>)
+data <- read.spss ("<? getRK ("file"); ?>"<? echo ($data_frame_opt); echo ($labels_opt); ?>)
 <?	if (getRK_val ("do_locale_conversion")) {
 		$from_locale = getRK_val ("encoding");
 		if ($from_locale == "other") {
@@ -40,24 +41,25 @@
 		} ?>
 
 # convert all strings to the current encoding
-<? echo ($object); ?> <- iconv.recursive (<? echo ($object); ?>, from="<? echo ($from_locale); ?>")
+data <- iconv.recursive (data, from="<? echo ($from_locale); ?>")
 <?	}
 	if (getRK_val ("convert_var_labels")) { ?>
 
 # set variable labels for use in RKWard
-labels <- attr (<? echo ($object); ?>, "variable.labels");
+labels <- attr (data, "variable.labels");
 if (!is.null (labels)) {
 	for (i in 1:length (labels)) {
 		col <- make.names (names (labels[i]))
 		if (!is.null (col)) {
-			rk.set.label (<? echo ($object); ?>[[col]], labels[i])
+			rk.set.label (data[[col]], labels[i])
 		}
 	}
 }
-<?	}
+<?	} ?>
+
+<? echo ($object); ?> <<- data		# assign to globalenv()
+<?
 	if (getRK_val ("doedit") && $data_frame) { ?>
-
-<? echo ($object); ?> <<- <? echo ($object); ?>		# assign to globalenv()
 rk.edit (<? echo ($object); ?>)
 <?	}
 }


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