[R] cat, and printing the last separator

Federico Calboli f.calboli at imperial.ac.uk
Wed Jan 25 12:35:08 CET 2012


Hi All,

I have the following command:

cat(rbind(table(gen$sex, gen$ddn2)[1,],round(table(gen$sex, gen$ddn2)[1,]/apply(table(gen$sex, gen$ddn2),2,sum) * 100)), sep = c(' (','%)\n'), file = '')

3 (20%)
17 (30%)
15 (31

i.e. it does NOT print the last separator, which is something that bugs me a bit, given that fact I'm trying to have some copy-paste ready stuff to put in a table.

How would I overcome this issue? I tried a number of things, all of which have failed.

BW

F



--
Federico C. F. Calboli
Neuroepidemiology and Ageing Research
Imperial College, St. Mary's Campus
Norfolk Place, London W2 1PG

Tel +44 (0)20 75941602   Fax +44 (0)20 75943193

f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com



More information about the R-help mailing list