[rkward-cvs] SF.net SVN: rkward:[2754] trunk/rkward/rkward/plugins/00saveload/import

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Feb 25 21:04:32 UTC 2010


Revision: 2754
          http://rkward.svn.sourceforge.net/rkward/?rev=2754&view=rev
Author:   tfry
Date:     2010-02-25 21:04:32 +0000 (Thu, 25 Feb 2010)

Log Message:
-----------
convert remaining import plugin to JS

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/00saveload/import/import_stata.js
    trunk/rkward/rkward/plugins/00saveload/import/import_stata.xml

Removed Paths:
-------------
    trunk/rkward/rkward/plugins/00saveload/import/import_stata.php

Modified: trunk/rkward/rkward/plugins/00saveload/import/import_stata.js
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_stata.js	2010-02-25 21:01:26 UTC (rev 2753)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_stata.js	2010-02-25 21:04:32 UTC (rev 2754)
@@ -1,22 +1,9 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Warning: please check correctness of conversion of '=>' in arrays by hand
-Warning: please check correctness of conversion of '=>' in arrays by hand
-
----------------------------- */
-
-// globals
-var undefined;
-
 function preprocess () {
 	echo ('require (foreign)\n');
 }
 
 function calculate () {
 	var options = "";
-	var object = "";
-	options = "";
 
 	if (getValue ("convert_dates")) {
 		options += ", convert.dates=TRUE" ;
@@ -42,7 +29,7 @@
 		options += ", convert.underscore=FALSE" ;
 	}
 
-	object = getValue ("saveto");
+	var object = getValue ("saveto");
 
 	echo ('data <- read.dta ("' + getValue ("file") + '"' + options + ')\n');
 	echo ('\n');
@@ -64,6 +51,6 @@
 }
 
 function printout () {
-	makeHeaderCode ("Import Stata File", new Array("File" ,  getValue ("file"), "Imported to" ,  getValue ("saveto")));
+	makeHeaderCode ("Import Stata File", new Array("File", getValue ("file"), "Imported to", getValue ("saveto")));
 }
 

Deleted: trunk/rkward/rkward/plugins/00saveload/import/import_stata.php
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_stata.php	2010-02-25 21:01:26 UTC (rev 2753)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_stata.php	2010-02-25 21:04:32 UTC (rev 2754)
@@ -1,59 +0,0 @@
-<?php
-function preprocess () { ?>
-require (foreign)
-<?
-}
-
-function calculate () {
-	$options = "";
-
-	if (getRK_val ("convert_dates")) {
-	       $options .= ", convert.dates=TRUE" ;
-	} else {
-	       $options .= ", convert.dates=FALSE" ;
-	}
-
-	if (getRK_val ("convert_factors")) {
-	       $options .= ", convert.factors=TRUE" ;
-	} else {
-	       $options .= ", convert.factors=FALSE" ;
-	}
-
-	if (getRK_val ("missing_type")) {
-	       $options .= ", missing.type=TRUE" ;
-	} else {
-	       $options .= ", missing.type=FALSE" ;
-	}
-
-	if (getRK_val ("convert_underscore")) {
-	       $options .= ", convert.underscore=TRUE" ;
-	} else {
-	       $options .= ", convert.underscore=FALSE" ;
-	}
-
-	$object = getRK_val ("saveto");
-?>
-data <- read.dta ("<? getRK ("file"); ?>"<? echo ($options); ?>)
-
-# set variable labels for use in RKWard
-labels <- attr (data, "var.labels")
-if (!is.null (labels)) {
-        for (i in 1:length (labels)) {
-                col <- make.names (attr (data, "names")[i] )
-                if (!is.null (col)) {
-                        rk.set.label (data[[col]], labels[i])
-                }
-        }
-}
-
-<? echo ($object); ?> <<- data		# assign to globalenv()
-<?
-	if (getRK_val ("doedit") ) { ?>
-rk.edit (<? echo ($object); ?>)
-<?	}
-}
-
-function printout () {
-	makeHeaderCode ("Import Stata File", array ("File" => getRK_val ("file"), "Imported to" => getRK_val ("saveto")));
-}
-?>

Modified: trunk/rkward/rkward/plugins/00saveload/import/import_stata.xml
===================================================================
--- trunk/rkward/rkward/plugins/00saveload/import/import_stata.xml	2010-02-25 21:01:26 UTC (rev 2753)
+++ trunk/rkward/rkward/plugins/00saveload/import/import_stata.xml	2010-02-25 21:04:32 UTC (rev 2754)
@@ -1,6 +1,6 @@
 <!DOCTYPE rkplugin>
 <document>
-	<code file="import_stata.php" />
+	<code file="import_stata.js" />
 	<help file="import_stata.rkh" />
 	<logic>
 		<external id="filename"/>


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