[rkward-users] [rkward - Help] RE: Import spss bugfixes
SourceForge.net
noreply at sourceforge.net
Mon Dec 17 20:27:40 UTC 2007
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=4679550
By: fsando
I tried to post to rkward-devel but received this error
550-Postmaster verification failed
[...]
50-Several RFCs state that you are required to have
a postmaster 550-mailbox for each mail domain. This host does not accept
mail 550-from domains whose servers reject the postmaster address. 550
Sender verify failed (in reply to RCPT TO command)
I don't know if it's just because I'm posting to soon after joining or it's
a setting on my mail server. If it persists I may post here until it is solved.
Anyway this is the what I tried to post:
the diff-file is pasted at the end
==================================================================
I believe there are a couple of errors in the code generated by the
"Import SPSS file" dialog. I have created a patch that should correct this.
I have attached the diff-file (svn diff)
The two errors are:
1) When the "Use value labels" is deselected the "use.value.labels" argument
is removed (i.e. set to default) but default=TRUE it should be
"use.value.label=FALSE".
I made an else clause for when getRK_val ("use_labels") is FALSE.
Perhaps it would be better to use default arguments and only act when getRK_val
("use_labels") is FALSE but I cannot easily determine the consequences of that,
thus this approach.
2) When "Edit" is deselected the assignment to globalenv is removed along with
the "edit" statement. I moved the assignment outside the "doedit" condition.
I considered the problem with value labels and they way the enter into rkward
via the levels attribute. I thought it would be relatively easy but to do something
about it, not so. Problem now is that you can't assign labels to non-positive
values in rkward editor.
I have this idea but don't know if it is at all doable: what about having an
extra field for value labels (like the current one that refers to levels). This
field should have two columns the first for the values, the second for their
corresponding labels. A third column could be added that indicate missing values.
I know there would be issues related to the way R handles data.frame etc. not
easily solved.
I am not a c-programmer so, of course, it's easy to dream up all kinds of "brilliant"
ideas, but anyway.
Kind
Regards
Finn
===================================================================
diff-file
Index: rkward/plugins/00saveload/import/import_spss.php
===================================================================
--- rkward/plugins/00saveload/import/import_spss.php (revision 2280)
+++ rkward/plugins/00saveload/import/import_spss.php (working copy)
@@ -17,17 +17,22 @@
}
<? }
}
-
+// when "Use value labels" is deselected, "use.value.labels" is removed - i.e.
set to default but default=TRUE - should be FALSE
function calculate () {
if (getRK_val ("data_frame")) {
$data_frame = true;
$data_frame_opt = ", to.data.frame=TRUE";
}
-
- if (getRK_val ("use_labels")) {
+//"Use value labels" selected, use.value.label=TRUE
+ 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
+//"Use value labels" deselected, use.value.label=FALSE
+ {
+ $labels_opt = ", use.value.labels=FALSE";
+ if (getRK_val ("trim_labels")) $labels_opt .= ", trim.factor.names=TRUE";
}
$object = getRK_val ("saveto");
@@ -54,10 +59,11 @@
}
}
}
+<? //assign imported data to globalenv moved outside the doedit condition,
will always be executed ?>
+<? echo ($object); ?> <<- <? echo ($object); ?> # assign to globalenv()
<? }
if (getRK_val ("doedit") && $data_frame) { ?>
-<? echo ($object); ?> <<- <? echo ($object); ?> # assign to globalenv()
rk.edit (<? echo ($object); ?>)
<? }
}
@@ -65,3 +71,7 @@
function printout () {
}
?>
______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=165574
More information about the Rkward-users
mailing list