Skip to content

How to display data content on a only row?

5 messages · Dieter Menne, Thom_249

#
Hi

I'm sorry for my so basic question, but it's so basic that I can't find
anwser anywhere...

I have data like this:
 [1] 16.8000000  6.5333333  5.0666667  3.9333333  2.2000000  1.6666667
 [7]  1.2000000  1.0666667  0.7333333  0.6666667

 [1] 35.6113946  6.9576953  4.5271667  2.3744674  1.4735768  1.1751393
 [7]  1.2649111  0.7988086  0.7037316  0.7237469

 [1] 32.9333333 15.6666667  8.1333333  6.5333333  2.8000000  2.2666667
 [7]  1.4666667  0.7333333  0.7333333  0.6666667

 [1] 27.4992641 10.2794293  3.4198301  2.3864698  1.4735768  1.2227993
 [7]  1.1872337  0.7037316  1.0327956  0.7237469

 [1] 234.5333333  11.3333333   5.8000000   2.9333333   2.0000000   1.5333333
 [7]   0.9333333   0.6666667   0.2666667   0.5333333

 [1] 425.7797665   9.5966264   4.2627959   2.4043611   2.0701967   1.5522641
 [7]   1.0997835   1.0465362   0.5936168   0.7432234

 [1] 430.26666667  18.20000000   4.53333333   2.13333333   1.06666667
 [6]   0.40000000   0.06666667   0.26666667   0.06666667   0.06666667

 [1] 450.8085540  17.1514264   4.7938453   2.5597619   2.2824381   0.9102590
 [7]   0.2581989   0.5936168   0.2581989   0.2581989

And I want that all these data, printed on a 4 rows instead of 8, and it's
be great without the "[x]"

How can I don that?

Regards

Thomas
#
Thom_249 wrote:
First look would be cat(). Second, tell us where you got the data from.
Matrix? 
Many vectors? 

Dieter
#
Hello Dieter

I got them from a Matrix on with I use the applyfunction tu compute the mean
columns by columns

print(apply(matSD,2,mean))

So it's a kind of vector.

I'll check with the cat function

Thank you, have a nice day

Thomas
#
Thom_249 wrote:
matSD = matrix(round(rnorm(20),2),nrow=4)
cat(matSD)
print(matSD)
dput(matSD) # How to send this matrix to r-help

newMat = apply(matSD,2,mean)
print(newMat)
cat(newMat,"\n")
dput(newMat) # Good for r-help questions