[R] HTML nsmall vector format problem

From: john seers (IFR) <john.seers_at_bbsrc.ac.uk>
Date: Fri 09 Jun 2006 - 19:58:16 EST

 

Hello All  

I am having a bit of trouble formatting my HTML with the desired number of digits after the decimal place. Am I doing something wrong/misunderstanding or is it a bug?  

Looking at the example supplied with ?HTML.data.frame:  

 HTML(iris[1:2,1:2],nsmall=c(3,1),file="")

Gives html output that includes the lines:  

</tr> <tr><td class=firstcolumn>1</td><td

class=cellinside>5.100</td><td class=cellinside>3.500</td></tr>

<tr><td class=firstcolumn>2</td><td class=cellinside>4.900</td><td
class=cellinside>3.000</td></tr>

My understanding of how nsmall works, as a vector, the output should be something like:  

</tr> <tr><td class=firstcolumn>1</td><td class=cellinside>5.100</td><td class=cellinside>3.5</td></tr>
<tr><td class=firstcolumn>2</td><td class=cellinside>4.900</td><td
class=cellinside>3.0</td></tr>

i.e. first column with 3 digits after the decimal place and the second column with 1 digit after the decimal place.  

It appears to only use the first value in the vector.  

Has anybody got any suggestions?  

Thanks for any help.  

John Seers      

---

John Seers
Institute of Food Research
Norwich Research Park
Colney
Norwich
NR4 7UA
 

tel +44 (0)1603 251497
fax +44 (0)1603 507723
e-mail john.seers@bbsrc.ac.uk                         
e-disclaimer at http://www.ifr.ac.uk/edisclaimer/
<http://www.ifr.ac.uk/edisclaimer/>  
 
Web sites:

www.ifr.ac.uk <http://www.ifr.ac.uk/>    
www.foodandhealthnetwork.com <http://www.foodandhealthnetwork.com/> 
 

	[[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri Jun 09 20:00:42 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 11 Jun 2006 - 05:34:52 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.