Re: [R] Formatting a Table

2009-07-08 Thread David Huffer
lp@r-project.org Subject: [R] Formatting a Table I've created a short program to print a table of learning curve factors. However, I cannot figure out how to format the table to: 1) Get rid of the [1]s in the first column and replace it with the values of N. 2) Line up the first row with the fa

Re: [R] Formatting a Table

2009-07-08 Thread Godmar Back
You could use 'cat(sprintf())', C-style: > for (N in seq(2,10,2)) + {if (N==2){cat(sprintf("%5d", T(N,Lc)*100),"\n")}else{cat(sprintf("%5.3f", T(N,Lc)), "\n")}} 707580858995 0.490 0.562 0.640 0.722 0.810 0.902 0.398 0.475 0.562 0.657 0.762 0.876 0.343 0.422 0.512 0.614 0.729

[R] Formatting a Table

2009-07-08 Thread cvandy
I've created a short program to print a table of learning curve factors. However, I cannot figure out how to format the table to: 1) Get rid of the [1]s in the first column and replace it with the values of N. 2) Line up the first row with the factors (decimal fractions). Thanks for any help. The