[R] Output formatting in Latex and R

Manish Gupta
Mon, 19 Mar 2012 01:58:35 -0000

I am working on Latex and R and using following code.

<<echo=FALSE>>infile<-read.table("test.txt",sep="\t")
Col3 <- unique(infile[,3])
LCol3 <- length(Col3)
for (i in 1:LCol3) {


print(paste("Column", Col3[i]))
print(infile[infile[,3]==Col3[i],-3])
}
@

I am getting following output.

1] "Column C" V1 V2 V4 1 A B D 2 X T K [1] "Column Z" V1 V2
V4 3 Z U M 4 E V
R 5 Z U M [1] "Column P" V1 V2 V4 6 E V R

    Blockquote

I want to avoid numbering and columns names. I want my output as follows.

"Column C" A B D X T K

"Column Z" Z U M E V R Z U M

"Column P" E V R

How can i implement it?


--
View this message in context: