Hello!

I am working on a statistical package called VOStat 
(http://vo.iucaa.ernet.in/~voi/VOStat.html) which uses a Java based GUI 
to input data and parameters from the user. Based on the inputs, an 
appropriate R script is generated and executed in the R console. As an 
example, consider the output to be a data frame. This data frame is 
printed in a well formatted way in the R console but the formatting is 
lost when the output is captured in a text file, which is later printed 
as output by the VOStat GUI. I have ways to format the output using Java 
by displaying it in a tabular form with grid lines. But I am facing 
problems in doing so when the R output is truncated to a new line, for 
instance when the number of columns is large. A trivial example is 
mentioned below:-

new_df<- data.frame("League Position"=1, "Team"="Manchester City", "Games 
played"=38, "Games won"=28, "Games drawn"=5, "Games lost"=5, "Goals scored"=93, 
"Goals conceded"=29, "Goal difference"=64, "Points"=89)

print(new_df, row.names=FALSE)
  League.Position                        Team Games.played Games.won 
Games.drawn Games.lost Goals.scored
                           1    Manchester City                     38          
     28                        5                 5                   93
  Goals.conceded Goal.difference Points
                         29                       64     89



So my question is whether there is a way to prevent R from wrapping the 
output so that all columns of a row can displayed in a single line in 
the console or should I start thinking of alternate ways to do the 
formatting?

Many thanks for your help.

Regards
Tejas Kale
IUCAA, Pune


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to