Message-ID: <3B5823541A25D311B3B90008C7F9056410E352B0@ntmsg0092.corpmail.telstra.com.au>
Date: 2004-02-05T23:08:40Z
From: Briggs, Meredith M
Subject: Histograms by two factors
Hi
I am trying to print out means, STDs and histograms under two sets of factors. I can manage it for one set - see below but not for two sets. That is, I want ot print out the mean STD and Histogram for each ITEM code within each DELIVERABLE code. In addition I can only get to view the histogram for the last item. How do you get R to stop overriding the histogram for eg level 1 for factor 1 by level 2 of factor 1?
thanks
X11()
Indat <- read.table ("C:/testdata.txt",header=T)
B <- c(Indat[,1],Indat[,2],Indat[,3],Indat[,4],Indat[,5])
y <- Indat[,5]/Indat[,4]
DELIV <- Indat[,1]
ITEM <- Indat[,3]
Df1 <- factor(DELIV)
Df2 <- factor(ITEM)
d1 <- tapply(y,Df1, mean)
d2 <- tapply(y, Df1,sd)
d3 <- tapply(y, Df1,max)
d4 <- tapply(y, Df1,hist)
print(d1)
print(d4)