[R] boxplot help
Bernardo Rangel Tura
tura at centroin.com.br
Sun Aug 3 11:37:00 CEST 2008
Em Sex, 2008-08-01 às 14:16 -0700, Rajasekaramya escreveu:
> hi
>
> I have list of matrix of lenggth 61 containg the mean values..I want
to make
> a boxplot for each of the matrix.
> I used a for loop but i cant figure out the way to save in the
boxplots
>
> > all.the.mean
> [[1]]
> mean
> 0.5
> o.6
> 0.8
> [[2]]
> 0.6
> 0.6
> 0.9
> now i want the boxplot for each of the matrix in a seperate window.my
code
> for(i in 1:length(all.the.mean)
> {
> windows()
> boxplot(all.the.mean[[i]]
> }
> this prints in all the boxplots but it cant be saved i dont know to
save
> those
> plz help me on this
Rajasekaramya,
Have 2 forms to save a plot using savePlot ou using device like: jpeg(),
png() or pdf() in you case
for(i in 1:length(all.the.mean){
windows()
boxplot(all.the.mean[[i]]
title<-paste("Mean",i,sep="-")
savePlot(filename = title,type = c("png"))
}
OR
for(i in 1:length(all.the.mean){
windows()
title<-paste(i,"png",sep=".")
png(filename =tilte)
boxplot(all.the.mean[[i]]
dev.off()
}
--
Bernardo Rangel Tura, M.D,MPH,Ph.D
National Institute of Cardiology
Brazil
More information about the R-help
mailing list