I am running this code:
max.print <- getOption('max.print')
options(max.print=nrow(countryaccepted) * ncol(countryaccepted))
sink(file.txt, append=TRUE, type="out")
cat("*************************\n")
cat("F-Test and T-Test Results")
as.array(HypothesisTesting)
cat("\n\n\n")
sink()
options(max.print=max.print)
The variable "HypothesisTesting" is a 3D array having dimensions 2 x 2 x 2 and contains values of type "double".
I am getting only following result in the file when I run the code via "Source"
*************************
F-Test and T-Test Results
But when I run it in "Console", I get following result saved in the file:
*************************
F-Test and T-Test Results
, , TTest
H0 Accepted H0 Rejected
Ho True 98.68938 0.970427
H0 False 8.62801 1.310620
, , FTest
H0 Accepted H0 Rejected
Ho True 100.0000 4.22076
H0 False 7.50504 0.00000
Why is the result not getting saved via source and why is it getting saved only via console?
Where am I wrong?