~l3on/ubuntu/precise/rkward/rebuild1

« back to all changes in this revision

Viewing changes to rkward/plugins/plots/irt/polytomous/plot_pcm.js

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Friedrichsmeier
  • Date: 2009-10-26 14:30:00 UTC
  • mfrom: (1.1.13 upstream) (6.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20091026143000-wzwt6cryjnwce23k
Tags: 0.5.2-1
* new upstream release
  closes: #551306 (added support for the new dynamic help system)
* Add "DM-Upload-Allowed: yes" in control
* bump standards version to 3.8.3 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// globals
 
2
 
 
3
function preprocess () {
 
4
  
 
5
 
 
6
echo ('  require(eRm)\n');
 
7
}
 
8
 
 
9
 
 
10
function printout () {
 
11
        doPrintout (true);
 
12
}
 
13
 
 
14
function preview () {
 
15
        preprocess ();
 
16
        calculate ();
 
17
        doPrintout (false);
 
18
}
 
19
 
 
20
function doPrintout (final) {
 
21
        
 
22
        
 
23
        
 
24
 
 
25
  
 
26
  inp_items        = getValue("inp_items");
 
27
  spin_abilfrom    = getValue("spin_abilfrom");
 
28
  spin_abilto      = getValue("spin_abilto");
 
29
  spin_probfrom    = getValue("spin_probfrom");
 
30
  spin_probto      = getValue("spin_probto");
 
31
  annotation       = getValue("annotation");
 
32
  chk_ask          = getValue("chk_ask");
 
33
  chk_mplot        = getValue("chk_mplot");
 
34
 
 
35
  
 
36
  plot_options     = getValue("plotoptions.code.printout");
 
37
  plot_ops_main    = getValue("plotoptions.main");
 
38
  plot_ops_type    = getValue("plotoptions.pointtype");
 
39
  plot_ops_xlab    = getValue("plotoptions.xlab");
 
40
  plot_ops_ylab    = getValue("plotoptions.ylab");
 
41
 
 
42
  
 
43
  
 
44
  options = array() ;
 
45
  
 
46
  if(inp_items) {
 
47
    
 
48
    
 
49
    inp_items = str_replace("-",":",inp_items);
 
50
    arr_items = split('[ ;]', inp_items);
 
51
    options[] = "item.subset=c("+join(",", arr_items)+")"; }
 
52
  if(chk_mplot == "mplot")
 
53
    options[] = "mplot=TRUE" ;
 
54
  if(chk_ask != "ask")
 
55
    options[] = "ask=FALSE" ;
 
56
 
 
57
  
 
58
  
 
59
  if((spin_abilfrom != "-4" || spin_abilto != "4") && spin_abilfrom < spin_abilto)
 
60
    options[] = "xlim=c("+round(spin_abilfrom,2)+","+round(spin_abilto,2)+")" ;
 
61
  if((spin_probfrom != "0" || spin_probto != "1") && spin_probfrom < spin_probto)
 
62
    options[] = "ylim=c("+round(spin_probfrom,2)+","+round(spin_probto,2)+")" ;
 
63
  
 
64
  if(annotation == "plain")
 
65
    options[] = "legpos=FALSE" ;
 
66
 
 
67
        if (final) { 
 
68
echo ('rk.header("Partial credit model plot")\n');
 
69
echo ('\n');
 
70
echo ('rk.graph.on()\n');
 
71
      }
 
72
        
 
73
 
 
74
        
 
75
echo ('try(plotICC(' + getValue("x"));
 
76
              if(options) echo (", "+join(", ", options));
 
77
              if(plot_options) echo (plot_options);
 
78
          echo ('))\n');
 
79
        if (final) { 
 
80
echo ('rk.graph.off()\n');
 
81
}
 
82
}