I want to build a subplot wherein overlaying several hystograms and without normalize each hystogram. So, I thought to use the function subplot() of the library "TeachingDemos", writing the function of the first hystogram and to add the looping for the drawing of the others hystograms:
filelog<- (Sys.glob("*.log"))
y<- read.table(file="data.log",skip=2,head=T)
ffl<- filelog[!Sys.glob("*.log") %in% "data.log"]
subplot(hist(y,breaks=(seq(0,10,by=1),main="",xlab="",xlim=c(0,10), ylab=""
for i in 1:length(ffl)){
x<-read.table(file=ffl[i],skip=2,head=T)
hist(x[,"trees"],breaks=(seq(0,10,by=1)),main="",xlab="",xlim=c(0,10), ylab="",axes=FALSE),
grconvertX(c(.7, .9), "user"), grconvertY(c(.1, .4), "user"))}
}
dev.off()
It doesn't work. Do you know why? I was thinking that maybe I have missed the way to do a function within another function.