Re: [R] Controlling the precision of the digits printed

2011-11-15 Thread Kevin Burton
Thank you. I mainly didn't know about the vector/matrix printing rules. Kevin -Original Message- From: William Dunlap [mailto:wdun...@tibco.com] Sent: Tuesday, November 15, 2011 10:43 AM To: Kevin Burton; r-help@r-project.org Subject: RE: [R] Controlling the precision of the d

Re: [R] Controlling the precision of the digits printed

2011-11-15 Thread William Dunlap
When you print a vector R uses a single format for the whole vector and tries to come up with one format that displays all the values accurately enough. For a matrix (or data.frame) it uses a different format for each column, so perhaps you would like the output of: > matrix(a, nrow=1, dimnames

Re: [R] Controlling the precision of the digits printed

2011-11-15 Thread Joshua Wiley
Hi Kevin, I am not sure you will find anything other than manual tweaking, that will vary between no decimals for integers, some for small fractions, and scientific for very small. You can also look at: ?round ?format. If this is for code/a report, you could make any formatting you wanted with