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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Sep 26 17:15:37 UTC 2012


Revision: 4316
          http://rkward.svn.sourceforge.net/rkward/?rev=4316&view=rev
Author:   tfry
Date:     2012-09-26 17:15:37 +0000 (Wed, 26 Sep 2012)
Log Message:
-----------
Adjust IRT plugins to support pre-plot options (currently margin), and adjust standards to match resulting formatting changes.

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.js
    trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.xml
    trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_rasch.js
    trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_tpm.js
    trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_grm.js
    trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_pcm.js
    trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_rsm.js
    trunk/rkward/rkward/plugins/plots/irt/tests/eRm_plotLR.js
    trunk/rkward/tests/item_response_theory/Andersen_LR_plot.rkcommands.R
    trunk/rkward/tests/item_response_theory/plot_2PL.rkcommands.R
    trunk/rkward/tests/item_response_theory/plot_3PL.rkcommands.R
    trunk/rkward/tests/item_response_theory/plot_GRM.rkcommands.R
    trunk/rkward/tests/item_response_theory/plot_PCM.rkcommands.R
    trunk/rkward/tests/item_response_theory/plot_RSM.rkcommands.R
    trunk/rkward/tests/item_response_theory/plot_Rasch.rkcommands.R

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2012-09-26 17:13:29 UTC (rev 4315)
+++ trunk/rkward/ChangeLog	2012-09-26 17:15:37 UTC (rev 4316)
@@ -1,4 +1,4 @@
-- Most plot plugins gain options to control margins and tick label orientation				TODO: add test(s), adjust existing test standards where needed, adjust IRT plugins
+- Most plot plugins gain options to control margins and tick label orientation				TODO: add test(s)
 - Added option for installing packages from source (implicitly enabled on Unixoid platforms)
 - Fixed: Wrong handling of carriage returns ('\r') in the console window				TODO: also fix for the command log and other places
 - Fixed: Spinboxes had wrong initial values

Modified: trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.js	2012-09-26 17:13:29 UTC (rev 4315)
+++ trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.js	2012-09-26 17:15:37 UTC (rev 4316)
@@ -79,33 +79,38 @@
 		echo ('rk.graph.on()\n');
 	}
 	// only the following section will be generated for full==false
+	echo ('try({\n');
+	printIndentedUnlessEmpty ('\t', getValue ("plotoptions.code.preprocess"), '', '\n');
 
 	// first we'll check wheter standard error curves should be plotted,
 	// because it takes two steps to draw them:
 	if (plot_type == "SEC") {
 	echo ('# two steps are needed to plot standard error curves\n');
-		echo ('# first some values are generated...\n');
-		echo ('res <- try(plot(' + getValue("x"));
+		echo ('	# first some values are generated...\n');
+		echo ('	res <- plot(' + getValue("x"));
 		if (options.length > 0) echo(", "+options.join(", "));
-		echo ('))\n');
+		echo (')\n');
 		echo ('\n');
-		echo ('# ... and then they\'re used to plot the curves:\n');
-		echo ('try(plot(res[,"z"], 1/sqrt(res[,"info"]), lwd=2');
+		echo ('	# ... and then they\'re used to plot the curves:\n');
+		echo ('	plot(res[,"z"], 1/sqrt(res[,"info"]), lwd=2');
 		// we give some defaults, but they can be changed via the embedded plot options:
 		if (!plot_ops_type) echo(", type=\"l\"");
 		if (!plot_ops_xlab) echo(", xlab=\"Ability\"");
 		if (!plot_ops_ylab) echo(", ylab=\"Standard Error\"");
 		if (!plot_ops_main) echo(", main=\"Stadard Error of Measurement\"");
 		if (plot_options) echo(plot_options);
-		echo ('))\n');
+		echo (')\n');
 	}
 	// and this will be plotted if anything else than stadard error curves are chosen:
 	else {
-		echo ('try(plot(' + getValue("x"));
+		echo ('	plot(' + getValue("x"));
 		if (options.length > 0) echo(", "+options.join(", "));
 		if (plot_options) echo(plot_options);
-		echo ('))\n');
+		echo (')\n');
 	}
 
+	printIndentedUnlessEmpty ('\t', getValue ("plotoptions.code.calculate"), '\n', '');
+	echo ('})\n');
+
 	if (full) echo ('rk.graph.off()\n');
 }

Modified: trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.xml	2012-09-26 17:13:29 UTC (rev 4315)
+++ trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_ltm.xml	2012-09-26 17:15:37 UTC (rev 4316)
@@ -5,6 +5,7 @@
 
   <logic>
     <convert id="logic_items" mode="equals" sources="plot_type.string" standard="items" />
+    <set id="plotoptions.allow_ann" to="false"/>
 
     <connect client="plot_type_item.enabled" governor="logic_items" />
     <connect client="frame_items.enabled" governor="logic_items" />

Modified: trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_rasch.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_rasch.js	2012-09-26 17:13:29 UTC (rev 4315)
+++ trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_rasch.js	2012-09-26 17:15:37 UTC (rev 4316)
@@ -76,33 +76,38 @@
 		echo ('rk.graph.on()\n');
 	}
 	// only the following section will be generated for full==false
+	echo ('try({\n');
+	printIndentedUnlessEmpty ('\t', getValue ("plotoptions.code.preprocess"), '', '\n');
 
 	// first we'll check wheter standard error curves should be plotted,
 	// because it takes two steps to draw them:
 	if (plot_type == "SEC") {
-		echo ('# two steps are needed to plot standard error curves\n');
-		echo ('# first some values are generated...\n');
-		echo ('res <- try(plot(' + getValue("x"));
+		echo ('	# two steps are needed to plot standard error curves\n');
+		echo ('	# first some values are generated...\n');
+		echo ('	res <- plot(' + getValue("x"));
 		if (options.length > 0) echo(", "+options.join(", "));
-		echo ('))\n');
+		echo (')\n');
 		echo ('\n');
-		echo ('# ... and then they\'re used to plot the curves:\n');
-		echo ('try(plot(res[,"z"], 1/sqrt(res[,"info"]), lwd=2');
+		echo ('	# ... and then they\'re used to plot the curves:\n');
+		echo ('	plot(res[,"z"], 1/sqrt(res[,"info"]), lwd=2');
 		// we give come defaults, but they can be changed via the embedded plot options:
 		if (!plot_ops_type) echo(", type=\"l\"");
 		if (!plot_ops_xlab) echo(", xlab=\"Ability\"");
 		if (!plot_ops_ylab) echo(", ylab=\"Standard Error\"");
 		if (!plot_ops_main) echo(", main=\"Stadard Error of Measurement\"");
 		if (plot_options) echo(plot_options);
-		echo ('))\n');
+		echo (')\n');
 	}
 	// and this will be plotted if anything else than stadard error curves are chosen:
 	else {
-		echo ('try(plot(' + getValue("x"));
+		echo ('	plot(' + getValue("x"));
 		if (options.length > 0) echo(", "+options.join(", "));
 		if (plot_options) echo(plot_options);
-		echo ('))\n');
+		echo (')\n');
 	}
 
+	printIndentedUnlessEmpty ('\t', getValue ("plotoptions.code.calculate"), '\n', '');
+	echo ('})\n');
+
 	if (full) echo ('rk.graph.off()\n');
 }

Modified: trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_tpm.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_tpm.js	2012-09-26 17:13:29 UTC (rev 4315)
+++ trunk/rkward/rkward/plugins/plots/irt/dichotomous/plot_tpm.js	2012-09-26 17:15:37 UTC (rev 4316)
@@ -76,32 +76,38 @@
 		echo ('rk.graph.on()\n');
 	}
 	// only the following section will be generated for full==false
+	echo ('try({\n');
+	printIndentedUnlessEmpty ('\t', getValue ("plotoptions.code.preprocess"), '', '\n');
 
 	// first we'll check wheter standard error curves should be plotted,
 	// because it takes two steps to draw them:
 	if (plot_type == "SEC") {
-		echo ('# two steps are needed to plot standard error curves\n');
-		echo ('# first some values are generated...\n');
-		echo ('res <- try(plot(' + getValue("x"));
+		echo ('	# two steps are needed to plot standard error curves\n');
+		echo ('	# first some values are generated...\n');
+		echo ('	res <- plot(' + getValue("x"));
 		if (options.length > 0) echo(", "+options.join(", "));
-		echo ('))\n');
+		echo (')\n');
 		echo ('\n');
-		echo ('# ... and then they\'re used to plot the curves:\n');
-		echo ('try(plot(res[,"z"], 1/sqrt(res[,"info"]), lwd=2');
+		echo ('	# ... and then they\'re used to plot the curves:\n');
+		echo ('	plot(res[,"z"], 1/sqrt(res[,"info"]), lwd=2');
 		// we give some defaults, but they can be changed via the embedded plot options:
 		if (!plot_ops_type) echo(", type=\"l\"");
 		if (!plot_ops_xlab) echo(", xlab=\"Ability\"");
 		if (!plot_ops_ylab) echo(", ylab=\"Standard Error\"");
 		if (!plot_ops_main) echo(", main=\"Stadard Error of Measurement\"");
 		if (plot_options) echo(plot_options);
-		echo ('))\n');
+		echo (')\n');
 	}
 	// and this will be plotted if anything else than stadard error curves are chosen:
 	else {
-		echo ('try(plot(' + getValue("x"));
+		echo ('	plot(' + getValue("x"));
 		if (options.length > 0) echo(", "+options.join(", "));
 		if (plot_options) echo(plot_options);
-		echo ('))\n');
+		echo (')\n');
 	}
+
+	printIndentedUnlessEmpty ('\t', getValue ("plotoptions.code.calculate"), '\n', '');
+	echo ('})\n');
+
 	if (full) echo ('rk.graph.off()\n');
 }

Modified: trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_grm.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_grm.js	2012-09-26 17:13:29 UTC (rev 4315)
+++ trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_grm.js	2012-09-26 17:15:37 UTC (rev 4316)
@@ -84,33 +84,38 @@
 		echo ('rk.graph.on()\n');
 	}
 	// only the following section will be generated for $full==false
+	echo ('try({\n');
+	printIndentedUnlessEmpty ('\t', getValue ("plotoptions.code.preprocess"), '', '\n');
 
 	// first we'll check wheter standard error curves should be plotted,
 	// because it takes two steps to draw them:
 	if (plot_type == "SEC") {
-		echo ('# two steps are needed to plot standard error curves\n');
-		echo ('# first some values are generated...\n');
-		echo ('res <- try(plot(' + getValue("x"));
+		echo ('	# two steps are needed to plot standard error curves\n');
+		echo ('	# first some values are generated...\n');
+		echo ('	res <- plot(' + getValue("x"));
 		if (options.length > 0) echo(", "+options.join(", "));
-		echo ('))\n');
+		echo (')\n');
 		echo ('\n');
-		echo ('# ... and then they\'re used to plot the curves:\n');
-		echo ('try(plot(res[,"z"], 1/sqrt(res[,"test.info"]), lwd=2');
+		echo ('	# ... and then they\'re used to plot the curves:\n');
+		echo ('	plot(res[,"z"], 1/sqrt(res[,"test.info"]), lwd=2');
 		// we give come defaults, but they can be changed via the embedded plot options:
 		if (!plot_ops_type) echo(", type=\"l\"");
 		if (!plot_ops_xlab) echo(", xlab=\"Ability\"");
 		if (!plot_ops_ylab) echo(", ylab=\"Standard Error\"");
 		if (!plot_ops_main) echo(", main=\"Stadard Error of Measurement\"");
 		if (plot_options) echo(plot_options);
-		echo ('))\n');
+		echo (')\n');
 	}
 	// and this will be plotted if anything else than stadard error curves are chosen:
 	else {
-		echo ('try(plot(' + getValue("x"));
+		echo ('	plot(' + getValue("x"));
 		if (options.length > 0) echo(", "+options.join(", "));
 		if (plot_options) echo(plot_options);
-		echo ('))\n');
+		echo (')\n');
 	}
 
+	printIndentedUnlessEmpty ('\t', getValue ("plotoptions.code.calculate"), '\n', '');
+	echo ('})\n');
+
 	if (full) echo ('rk.graph.off()\n');
 }

Modified: trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_pcm.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_pcm.js	2012-09-26 17:13:29 UTC (rev 4315)
+++ trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_pcm.js	2012-09-26 17:15:37 UTC (rev 4316)
@@ -70,11 +70,16 @@
 		echo ('rk.graph.on()\n');
 	}
 	// only the following section will be generated for full==false
+	echo ('try({\n');
+	printIndentedUnlessEmpty ('\t', getValue ("plotoptions.code.preprocess"), '', '\n');
 
-	echo ('try(plotICC(' + getValue("x"));
+	echo ('	plotICC(' + getValue("x"));
 	if (options.length > 0) echo(", "+options.join(", "));
 	if (plot_options) echo(plot_options);
-	echo ('))\n');
+	echo (')\n');
 
+	printIndentedUnlessEmpty ('\t', getValue ("plotoptions.code.calculate"), '\n', '');
+	echo ('})\n');
+
 	if (full) echo ('rk.graph.off()\n');
 }

Modified: trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_rsm.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_rsm.js	2012-09-26 17:13:29 UTC (rev 4315)
+++ trunk/rkward/rkward/plugins/plots/irt/polytomous/plot_rsm.js	2012-09-26 17:15:37 UTC (rev 4316)
@@ -70,11 +70,16 @@
 		echo ('rk.graph.on()\n');
 	}
 	// only the following section will be generated for full==false
+	echo ('try({\n');
+	printIndentedUnlessEmpty ('\t', getValue ("plotoptions.code.preprocess"), '', '\n');
 
-	echo ('try(plotICC(' + getValue("x"));
+	echo ('	plotICC(' + getValue("x"));
 	if (options.length > 0) echo(", "+options.join(", "));
 	if (plot_options) echo(plot_options);
-	echo ('))\n');
+	echo (')\n');
 
-		if (full) echo ('rk.graph.off()\n');
+	printIndentedUnlessEmpty ('\t', getValue ("plotoptions.code.calculate"), '\n', '');
+	echo ('})\n');
+
+	if (full) echo ('rk.graph.off()\n');
 }

Modified: trunk/rkward/rkward/plugins/plots/irt/tests/eRm_plotLR.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/irt/tests/eRm_plotLR.js	2012-09-26 17:13:29 UTC (rev 4315)
+++ trunk/rkward/rkward/plugins/plots/irt/tests/eRm_plotLR.js	2012-09-26 17:15:37 UTC (rev 4316)
@@ -87,14 +87,19 @@
 		echo ('rk.graph.on()\n');
 	}
 	// only the following section will be generated for full==false
+	echo ('try({\n');
+	printIndentedUnlessEmpty ('\t', getValue ("plotoptions.code.preprocess"), '', '\n');
 
-	echo ('lr.res <- LRtest(' + getValue("x"));
+	echo ('	lr.res <- LRtest(' + getValue("x"));
 	if (options_lrtest.length > 0) echo(", "+options_lrtest.join(", "));
 	echo (')\n');
-	echo ('try(plotGOF(lr.res');
+	echo ('	plotGOF(lr.res');
 	if (options_plotgof.length > 0) echo(", "+options_plotgof.join(", "));
 	if (plot_options.length > 0) echo(plot_options);
-	echo ('))\n');
+	echo (')\n');
 
+	printIndentedUnlessEmpty ('\t', getValue ("plotoptions.code.calculate"), '\n', '');
+	echo ('})\n');
+
 	if (full) echo ('rk.graph.off()\n');
 }

Modified: trunk/rkward/tests/item_response_theory/Andersen_LR_plot.rkcommands.R
===================================================================
--- trunk/rkward/tests/item_response_theory/Andersen_LR_plot.rkcommands.R	2012-09-26 17:13:29 UTC (rev 4315)
+++ trunk/rkward/tests/item_response_theory/Andersen_LR_plot.rkcommands.R	2012-09-26 17:15:37 UTC (rev 4316)
@@ -5,7 +5,9 @@
 rk.header("Andersen's LR test")
 
 rk.graph.on()
-lr.res <- LRtest(estimates.pcm, se=TRUE)
-try(plotGOF(lr.res, conf=list(), ctrline=list()))
+try({
+	lr.res <- LRtest(estimates.pcm, se=TRUE)
+	plotGOF(lr.res, conf=list(), ctrline=list())
+})
 rk.graph.off()
 })

Modified: trunk/rkward/tests/item_response_theory/plot_2PL.rkcommands.R
===================================================================
--- trunk/rkward/tests/item_response_theory/plot_2PL.rkcommands.R	2012-09-26 17:13:29 UTC (rev 4315)
+++ trunk/rkward/tests/item_response_theory/plot_2PL.rkcommands.R	2012-09-26 17:15:37 UTC (rev 4316)
@@ -5,6 +5,8 @@
 rk.header("Two parameter logistic model plot")
 
 rk.graph.on()
-try(plot(estimates.2pl, type="ICC", items=c(1)))
+try({
+	plot(estimates.2pl, type="ICC", items=c(1))
+})
 rk.graph.off()
 })

Modified: trunk/rkward/tests/item_response_theory/plot_3PL.rkcommands.R
===================================================================
--- trunk/rkward/tests/item_response_theory/plot_3PL.rkcommands.R	2012-09-26 17:13:29 UTC (rev 4315)
+++ trunk/rkward/tests/item_response_theory/plot_3PL.rkcommands.R	2012-09-26 17:15:37 UTC (rev 4316)
@@ -5,6 +5,8 @@
 rk.header("Birnbaum three parameter model plot")
 
 rk.graph.on()
-try(plot(estimates.3pl, type="IIC", items=0))
+try({
+	plot(estimates.3pl, type="IIC", items=0)
+})
 rk.graph.off()
 })

Modified: trunk/rkward/tests/item_response_theory/plot_GRM.rkcommands.R
===================================================================
--- trunk/rkward/tests/item_response_theory/plot_GRM.rkcommands.R	2012-09-26 17:13:29 UTC (rev 4315)
+++ trunk/rkward/tests/item_response_theory/plot_GRM.rkcommands.R	2012-09-26 17:15:37 UTC (rev 4316)
@@ -5,6 +5,8 @@
 rk.header("Graded response model plot")
 
 rk.graph.on()
-try(plot(estimates.grm, type="ICC", items=c(6)))
+try({
+	plot(estimates.grm, type="ICC", items=c(6))
+})
 rk.graph.off()
 })

Modified: trunk/rkward/tests/item_response_theory/plot_PCM.rkcommands.R
===================================================================
--- trunk/rkward/tests/item_response_theory/plot_PCM.rkcommands.R	2012-09-26 17:13:29 UTC (rev 4315)
+++ trunk/rkward/tests/item_response_theory/plot_PCM.rkcommands.R	2012-09-26 17:15:37 UTC (rev 4316)
@@ -5,6 +5,8 @@
 rk.header("Partial credit model plot")
 
 rk.graph.on()
-try(plotICC(estimates.pcm, item.subset=c(3:6), mplot=TRUE, ask=FALSE))
+try({
+	plotICC(estimates.pcm, item.subset=c(3:6), mplot=TRUE, ask=FALSE)
+})
 rk.graph.off()
 })

Modified: trunk/rkward/tests/item_response_theory/plot_RSM.rkcommands.R
===================================================================
--- trunk/rkward/tests/item_response_theory/plot_RSM.rkcommands.R	2012-09-26 17:13:29 UTC (rev 4315)
+++ trunk/rkward/tests/item_response_theory/plot_RSM.rkcommands.R	2012-09-26 17:15:37 UTC (rev 4316)
@@ -5,6 +5,8 @@
 rk.header("Rating scale model plot")
 
 rk.graph.on()
-try(plotICC(estimates.rsm, item.subset=c(1:3), mplot=TRUE, ask=FALSE))
+try({
+	plotICC(estimates.rsm, item.subset=c(1:3), mplot=TRUE, ask=FALSE)
+})
 rk.graph.off()
 })

Modified: trunk/rkward/tests/item_response_theory/plot_Rasch.rkcommands.R
===================================================================
--- trunk/rkward/tests/item_response_theory/plot_Rasch.rkcommands.R	2012-09-26 17:13:29 UTC (rev 4315)
+++ trunk/rkward/tests/item_response_theory/plot_Rasch.rkcommands.R	2012-09-26 17:15:37 UTC (rev 4316)
@@ -5,6 +5,8 @@
 rk.header("Rasch model plot")
 
 rk.graph.on()
-try(plot(estimates.rasch, type="ICC", legend=TRUE))
+try({
+	plot(estimates.rasch, type="ICC", legend=TRUE)
+})
 rk.graph.off()
 })

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