Good Morning All,

I have working on a data set where I am finding mean and median for weight
variable on a daily basis. 
The code:

aggr<-aggregate(retail$weight,list(retail$ship.date),mean)
This is giving me an accurate result however with 4 decimal places for the
mean weight. In order to restrict it i used the following syntax:

format(aggr,digits=2,justify = c("right"))
After the execution of this code i have mean weight but now there are no
decimal places. Could you please advice what is incorrect in the syntax.

Thank you, Shivi



--
View this message in context: 
http://r.789695.n4.nabble.com/Restricting-Decimal-Places-in-the-Output-tp4708739.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to