[R] t.test using RSPerl

Wagle, Mugdha Mugdha.Wagle at STJUDE.ORG
Tue Jun 14 17:42:30 CEST 2005


Hi,
 
I've just started using R and RSPerl. I have some code as follows:
 
&R::initR("--no-save");
&R::call("t.test", (\@array1, \@array2));
 
where @array1 and @array2 are both 1-dimensional arrays in Perl having 54675 elements each. On execution the output is as follows:
 
Calling R function name `t.test', # arguments: 3
1) Arg type 3
Got a reference to a value 10
Here now!2) Arg type 3
Got a reference to a value 10
Here now!Calling R
t.test(c(0, 6.24280675278087, 6.35175793656943, 5.76925805661511,
7.0789316246711, 7.4636498661157, 8.13730810691084, 8.78203131644273,
9.64502765609435, 9.95631242346133, 5.83129579495516, 6.8798700754926,
7.31814159140937.......(REST OF THE ARRAY ELEMENTS).....
4.91632461462501, 3.38099467434464,
3.91800507710569, 3.23867845216438, 3.38439026334577, 4.64918707140487,
3.23474917402449, 3.62966009445396, 3.36729582998647, 3.91999117507732
))
Performed the call, result has length 9

My question is : with other functions such as sum and log10, the actual values of the result are displayed. Here the call seems to have worked but the output is not what you get when running t.test directly on the R command prompt..
 
data:  data4[2] and data4[3] 
t = 0.2186, df = 109.847, p-value = 0.8274
alternative hypothesis: true difference in means is not equal to 0 
95 percent confidence interval:
 -3722.830  4645.723 
sample estimates:
mean of x mean of y 
 6185.139  5723.693
 
which is what I had expected, after seeing the outputs in the case of simpler functions like sum. Could anyone please tell me how I can obtain the output I expect(i.e. the same as the command line output....giving values of t, p-value and the means)?
 
Thank you very much for the help!!
 
Sincerely,
Mugdha Wagle
Hartwell Center for Bioinformatics and Biotechnology,
St.Jude Children's Research Hospital, Memphis TN 38105




More information about the R-help mailing list