I have written a short test script that can be used to experiment with this. This reproduces the problem inconsistently but is easy to use and does not require any data input.
#!/usr/local/bin/perl # MaybeD # Test Script for Statistics::R. # 02 March 2006 # This is a short script that reproduces the hanging bug in the Statis +tics::R CPAN module, described at http://rt.cpan.org/Public/Bug/Displ +ay.html?id=11918. # 500 random 2x2 contingency tables are generated and a Fisher's Test +performed on these tables in R using Statistics::R. The output of the + tests is captured using $R->read and is printed to an output file in + the same directory as the perl script is located. # The script has been tested in Windows XP (using ActiveState Active P +erl ver. 5.8.6, R version 2.1.1, and Statistics::R 0.0.02). use strict; use statistics::R; my $statsr_test_out = "statsr_test_out.txt"; open (OUT, ">$statsr_test_out") || die print "MaybeD Test Script for S +tatistics::R could not open $statsr_test_out\n"; print "Current Loop Iteration\n"; my $R = Statistics::R->new() ; $R->startR; for (my $test_count=0; $test_count<500; $test_count++) # How many Fish +er's tests are performed in total (default is 500). { my @fisher_matrix = ""; for (my $var_count=0; $var_count<4; $var_count++) { my $random = int rand(10000); push (@fisher_matrix, $random); } shift(@fisher_matrix); my $fisher = join(",", @fisher_matrix); my $actual_test_count = $test_count + 1; print STDERR "$actual_test_count\r"; # Counter printed to the screen s +o you can keep an eye on the iterations of the loop (each iteration, +one Fisher's test is carried out). $R->send("Fisherout".$test_count."<- fisher.test(matrix(c(".$fisher.") +,nrow=2))"); $R->send("print(Fisherout".$test_count.")"); my $ret = $R->read; print OUT "$ret\n\n"; } $R->stopR;

In reply to Re: Buggy CPAN Module (Statistics::R) by maybeD
in thread Buggy CPAN Module (Statistics::R) by maybeD

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.